Reputation: 40755
I'm getting lots of console outputs like this without my application crashing:
malloc: * error for object 0xc6a3970: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug
How can I find out which object or variable is affected?
I tried setting a symbolic breakpoint like this but it never halts:
Upvotes: 152
Views: 144086
Reputation: 21383
Set a breakpoint on malloc_error_break() by opening the Breakpoint Navigator (View->Navigators->Show Breakpoint Navigator or ⌘8), clicking the plus button in the lower left corner, and selecting "Add Symbolic Breakpoint". In the popup that comes up, enter malloc_error_break
in the Symbol field, then click Done.
EDIT: openfrog added a screenshot and indicated that he's already tried these steps without success after I posted my answer. With that edit, I'm not sure what to say. I haven't seen that fail to work myself, and indeed I always keep a breakpoint on malloc_error_break set.
Upvotes: 160
Reputation: 341
I had the same problem with Xcode. I followed steps you gave and it didn't work. I became crazy because in every forum I saw, all clues for this problem are the one you gave. I finally saw I put a space after the malloc_error_break, I suppressed it and now it works. A dumb problem but if the solution doesn't work, be sure you haven't put any space before and after the malloc_error_break.
Hope this message will help..
Upvotes: 9
Reputation: 28559
I solve it by close safari inspector. Refer to my post. I also found sound sometimes when I run my app for testing, then I open safari with auto inspector on, after this, I do some action in my app then this issue triggered.
Upvotes: 2
Reputation: 41
I had given permissions I shouldn't have to write in some folders (especially /usr/bin/), and that caused the problem. I fixed it by opening Disk Utility and running 'Repair Disk Permissions' on the Macintosh HD disk.
Upvotes: 4
Reputation: 11724
In your screenshot, you didn't specify any module: try setting "libsystem_c.dylib"
I did that, and it works : breakpoint stops here (although the stacktrace often rise from some obscure system lib...)
Upvotes: 49