<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - Memory Leak and USER 42 - Comments</title>
 <link>http://www.newlc.com/topic-8935</link>
 <description>Comments for &quot;Memory Leak and USER 42&quot;</description>
 <language>en</language>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-45945</link>
 <description>&lt;p&gt;&lt;div class=&quot;bb-quote&quot;&gt;&lt;blockquote class=&quot;bb-quote-body&quot;&gt;I am also facing the same problem, Panic code USER 42. Application is running fine, but when I try to close the application it gives this error message. Can anyone please help me in this?..Please.&lt;/blockquote&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;There&#039;s lots of help already in the above discussion. What more do you want? Especially when you provide no code or context to you problem at all?!&lt;/p&gt;</description>
 <pubDate>Tue, 22 Apr 2008 09:00:05 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 45945 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-45943</link>
 <description>&lt;p&gt;I am also facing the same problem, Panic code USER 42. Application is running fine, but when I try to close the application it gives this error message. Can anyone please help me in this?..Please.&lt;/p&gt;</description>
 <pubDate>Tue, 22 Apr 2008 08:52:56 +0200</pubDate>
 <dc:creator>suryavardhan</dc:creator>
 <guid isPermaLink="false">comment 45943 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22101</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;USER 42 commonly occours if you are:&lt;br /&gt;&lt;br /&gt;1. trying to delete an object that is already deleted. (if two classes share a pointer, make sure only one of them is the &amp;quot;owner&amp;quot; responsible for deleting it)&lt;br /&gt;&lt;br /&gt;2. writeing outside the bounds of an array or similar, corrupting a pointer allocated next to it, that you then try to free. (for example an array as a member variable)&lt;br /&gt;&lt;br /&gt;3. writeing outside the bounds of an array or similar, that is allocated on the heap, corrupting the heap cell after the array, causing USER 42 when trying to delete that cell...&lt;br /&gt;&lt;br /&gt;Try look for those kinds of errors.&lt;/div&gt;</description>
 <pubDate>Wed, 11 Jan 2006 13:18:00 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 22101 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22100</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;pinky............have u solved the User 42 error.....I m also facing this error.............could anyone help?&lt;/div&gt;</description>
 <pubDate>Tue, 10 Jan 2006 10:25:32 +0100</pubDate>
 <dc:creator>impankaj24</dc:creator>
 <guid isPermaLink="false">comment 22100 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22099</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;br /&gt;U can put log statements, write those statements in the file. When panic occur... see the last statement in the log file.. &lt;br /&gt;It may be bit lenghty but there is no other way to debug on device as I know.&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 14:27:38 +0200</pubDate>
 <dc:creator>chitransh_chetan</dc:creator>
 <guid isPermaLink="false">comment 22099 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22098</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;No i am not trying to access or connect to some other application.&lt;br /&gt;I am testing this application on the device. &lt;br /&gt;&lt;br /&gt;How can i debug the crash point??&lt;br /&gt;&lt;br /&gt;Thx &lt;br /&gt;~Pinky&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 14:22:35 +0200</pubDate>
 <dc:creator>pinky_sharma</dc:creator>
 <guid isPermaLink="false">comment 22098 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22097</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;In ur application are you trying to access some other application which is continuously running in background..&lt;br /&gt;&lt;br /&gt; So while connecting to that server, may be at first time u r not getting any panic, but next time when u try to connect it, it throw a panic as the previous connection is still exist from same client.&lt;br /&gt;&lt;br /&gt;But u r right as it should give panic while exiting the application.&lt;br /&gt;one more thing that this panic is not related with releasing the resource, you r passing a reference of a not allocated memory location. It is very difficult to ssy anything without looking in code.&lt;br /&gt;&lt;br /&gt;Anyway, are u facing the problem on emulator or device? Try it on device first because...u should not believe on emulator everytime.&lt;br /&gt;if this does not resolve the problem than u can debug the crash point, where actually it is crashing.&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 14:15:47 +0200</pubDate>
 <dc:creator>chitransh_chetan</dc:creator>
 <guid isPermaLink="false">comment 22097 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22096</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Thx Very Much Chetan.&lt;br /&gt;I am not getting the Alloc Panic now. But I shud say its a kind of work around. This problem shud not come at the first place itself.&lt;br /&gt;If Symbian supports fopen/fclose then there shud be no memory leak of such kind.&lt;br /&gt;Anyway, i learned a useful thing today..Thx very much.&lt;br /&gt;&lt;br /&gt;Regarding the Reopening error, Yes i am rebuilding the whole application but to no avail. Actually there arei 2 things i am doing with the application.&lt;br /&gt;&lt;br /&gt;1. Just open the application ..close it...Now, there will be no error while reopening.&lt;br /&gt;&lt;br /&gt;2. Open the application....do sth (like, i am accessing camera for preview)...release the resources of camera...close the application....Now if i try to re-open, USER 42 comes. So probably I have missed sth while releasing the resources accquired by camera, but in this case it shud panic while closing the application for the first time but it does not panic at all..I am not getting any clue to this...&lt;br /&gt;&lt;br /&gt;Any Suggestions???&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thx&lt;br /&gt;~Pinky&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 13:58:44 +0200</pubDate>
 <dc:creator>pinky_sharma</dc:creator>
 <guid isPermaLink="false">comment 22096 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22095</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;That solution is for Alloc panic u r getting.. &lt;br /&gt;&lt;br /&gt;for USER 42, there might be something where u r refering a memory loaction which is not allocated. But it is strange that only reopening is givin u that panic.. Have you tried with rebuilding the whole application.&lt;br /&gt;and remember to call CloseSTDLIB() at the end ( while exiting the application ) if u r using the C STDLIB functions.&lt;br /&gt;&lt;br /&gt;savaa2: u should not delete fp. As it stores the reference to the file while we call fopen, but as soon as we call fclose, the reference gets delete. &lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 12:20:15 +0200</pubDate>
 <dc:creator>chitransh_chetan</dc:creator>
 <guid isPermaLink="false">comment 22095 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22094</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;okay. &lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 12:18:11 +0200</pubDate>
 <dc:creator>savaaZ</dc:creator>
 <guid isPermaLink="false">comment 22094 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22093</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Chetan:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I Tried using CloseSTDLIB() but to no avail. I am still getting the USER 42 while reopening.&lt;br /&gt;savaa2:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; There is no need to delete fp. fopen/fclose work like this only. And if u try deleting the fp, u will get a KERN-EXEC 3 panic,&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; which means a bad instruction in the sense that u r deleting a allready deleted thing.&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 12:09:47 +0200</pubDate>
 <dc:creator>pinky_sharma</dc:creator>
 <guid isPermaLink="false">comment 22093 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22092</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Shouldn&amp;#039;t you delete fp? &lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 11:50:23 +0200</pubDate>
 <dc:creator>savaaZ</dc:creator>
 <guid isPermaLink="false">comment 22092 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22091</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;The Symbian platform has a requirement that all resources which were allocated by an application must be cleaned up by the time the program terminates. On the Emulator, in debug builds, failure to do this will cause a panic from the __UHEAP_MARKEND macro.&lt;br /&gt;Because the data allocated in the thread-local storage for STDLIB&amp;#039;s DLL (the _reent structure) is not automatically cleaned up when the environment is destroyed, it must be cleaned up by the user of STDLIB.&lt;br /&gt;The function to achieve this is CloseSTDLIB(). To use this function, file epoc32\include\libc\sys\reent.h should be included in the project. Call CloseSTDLIB() after the point at which it is known that code in STDLIB&amp;#039;s DLL will no longer be called and its thread-local storage no longer needed.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 11:43:29 +0200</pubDate>
 <dc:creator>chitransh_chetan</dc:creator>
 <guid isPermaLink="false">comment 22091 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935#comment-22090</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;b&gt;USER 42&lt;/b&gt; - from SDK documentation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;This panic is raised by a number of RHeap member functions, AllocLen(), Free(), FreeZ(), ReAlloc(), ReAllocL(), Adjust() and AdjustL() when a pointer passed to these functions does not point to a valid cell.&lt;/b&gt; &lt;/div&gt;</description>
 <pubDate>Fri, 08 Jul 2005 11:26:40 +0200</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 22090 at http://www.newlc.com</guid>
</item>
<item>
 <title>Memory Leak and USER 42</title>
 <link>http://www.newlc.com/topic-8935</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/topic-8935&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/topic-8935#comments</comments>
 <category domain="http://www.newlc.com/forums/symbian-c">Symbian C++</category>
 <pubDate>Fri, 08 Jul 2005 11:16:34 +0200</pubDate>
 <dc:creator>pinky_sharma</dc:creator>
 <guid isPermaLink="false">9448 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
