Note that there are some explanatory texts on larger screens.

plurals
  1. POincorrect checksum for freed object - How do I troubleshoot on device?
    primarykey
    data
    text
    <p>I have spent several days trying to track down an error that many seasoned IOS developers have probably seen at one point or other in their career:</p> <pre><code>MyApp-IPad(1403,0x5ab3000) malloc: *** error for object 0x2b3aa04: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug </code></pre> <p>I've searched around on the net and discovered that many people recommend using <code>NSZombieEnabled</code> or <code>MallocStackLogging</code>, however it seems to be a given that these do not work unless you are using the simulator. Unfortunately I can never get my crash to occur unless I use the actual device, in which case it happens every few minutes.</p> <p>When using MallocStackLogging I get a file written to my local IPad (in /private/var/mobile/Applications/....) but there doesn't seem to be any way to transfer that .link file to my local machine (since the device isn't jailbroken) and even if I could there seems to be no way to use it on my local machine with malloc_history.</p> <p>The best I could do was get it to crash when running Instruments->Allocations, but when I looked at the region it pointed to 50+ allocations (from many different functions), but all were already deallocated and no longer live. And all of them were internal allocations, in ImageIO (start_pass_huff_decoder, etc.)</p> <p>I'm working with a fairly complex, large base of code, so code inspection of the entire project is not feasible.</p> <p>I really need some way to get the debugger to break as soon as the checksum is violated, rather than later when it just happens to be doing an unrelated malloc, which doesn't offer any useful information. Setting a breakpoint at <code>malloc_error_break</code> seems to have no effect.</p> <p>Its clear that I have an invalid pointer somewhere writing to memory it shouldn't be, but I'm stuck as to how to narrow down which piece of code is causing it.</p> <p>Any advice or suggestions would be very helpful!!!</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload