"EXC_BAD_ACCESS" with empty stack trace in simulation

Discuss any Chipmunk bugs here.
Post Reply
sergio
Posts: 1
Joined: Fri Nov 18, 2011 6:02 am
Contact:

"EXC_BAD_ACCESS" with empty stack trace in simulation

Post by sergio »

Hello to all,

I am developing an app based on Cocos2d+Chipmunk for iOS and I am experiencing random crashes during the simulation. Now, the bad part is that the stack trace that Xcode is showing is empty. This is GDB output to the bt command:

(gdb) bt
#0 0x00000000 in ?? ()

I am really at a loss here as to what could be causing the fault. I understand this is a matter of some pointer going NULL before its life ends, but due to the empty stack I have no idea about which op was last attempted.

The simulation can run any time from 5 secs to several minutes, but in the end it crashes. I am not getting any low memory warning; the app runs fine collision after collision until it crashes.

I am not at all meaning that this is a bug in Chipmunk, rather I am looking for a suggestion as to how to go about such case, where I have a crash, in the middle of a simulation, with an empty stack trace, so that I have really no clue about where to start from.

Which parts of Chipmunk could I "attack" with log traces or breakpoints in order to understand what is happening?

Thank you very much for your help!
Sergio
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: "EXC_BAD_ACCESS" with empty stack trace in simulation

Post by slembcke »

For one, make sure that you are running the program in debug mode. If compiler optimizations are turned on it can completely confuse the debugger.

Also, the blank stack sort of thing often happens when you attempt to call a function pointer that has an invalid address. This usually happens when you try to call a method on an Objective-C that has been deallocated or possibly something like a Chipmunk joint that was deallocated but never removed from the space.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests