Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set malloc_error_break in Xcode 4

Tags:

How do I set a malloc_error_break in Xcode4? Also, I seem to be getting this error malloc: *** error for object 0x4d80814: incorrect checksum for freed object - object was probably modified after being freed.

Is there anyway I can check what object 0x4d80814 is? It doesn't show up in the variables list in the debugger.

like image 744
Manish Burman Avatar asked Aug 06 '11 22:08

Manish Burman


2 Answers

I think this is how its done.

  • Click on the breakpoints navigator (looks like a sign post) on the top of the left bar on XCode 4.
  • On the bottom left hand corner there is a plus sign. Click on it.
  • Add Symbolic Breakpoint and set malloc_error_break as the symbol.
  • Click the next breakpoint button ( it looks like |> ) and is on the bottom panel. It will take you to the line that is causing the error.

Usually it is caused by objects being created as subobjects of other objects that don't exist yet (ie SKPhysicsBody being created before its spritenode exists)

like image 62
Manish Burman Avatar answered Sep 30 '22 20:09

Manish Burman


This is what the breakpoints button looks like:

enter image description here

And this is the plus sign at the bottom left hand corner:

enter image description here

Man, it took me a while to find both of them!

like image 35
Fran Sevillano Avatar answered Sep 30 '22 22:09

Fran Sevillano