In Xcode 4.x I've edited my Run scheme to 'Enable Guard Malloc' since I have a nondescript malloc error I need to track down. I'm aware I need to run in the simulator to use this feature. However, when I do so the app immediately freezes and Xcode shows me a stack trace that looks like this:
I've googled around to find a solution, but thus far no joy. It was reported elsewhere that I should be setting an environment variable in my scheme:
DYLD_INSERT_LIBRARIES -> /usr/lib/libgmalloc.dylib
However this doesn't solve the problem. I have also tried 'lsystem' as the value, but that didn't work either.
Can anyone suggest a solution to this dylib issue, or perhaps recommend an alternative to 'Enable Guard Malloc' to identify where a malloc'd heap area is being exceeded?
UPDATE
To clarify, this is the type of error I'm dealing with:
malloc: *** error for object 0x2b4b54: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
I've tried setting a symbol breakpoint of malloc_error_break
, however it still breaks 'randomly' upon memory issues rather than at the point of exceeding an allocated region.