[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - cpPostStepCallBack is murdering me

cpPostStepCallBack is murdering me

Official forum for the .

cpPostStepCallBack is murdering me

Postby rocity » Thu Dec 01, 2011 2:17 pm

My goodness, I'm sure a million forum topics on this have been created, but I can't find any that address the specific problem I'm having.

In my game, I am detecting a collision between two collision types. When this occurs, my collision handler tells one of the objects to destroy itself, and in its destruction method I have a cpSpaceAddPostStepCallback call to remove the object's physics objects. Shortly thereafter, the callback is called and the space is locked, so it says to use a post step callback...which I am.

My physics post step callback is called removePhysicsCallBack

My runtime stack looks like this:
#0 0x921c89c6 in __pthread_kill ()
#1 0x9012df78 in pthread_kill ()
#2 0x9011ebdd in abort ()
#3 0x00064c98 in cpMessage at /<redacted>/chipmunk.c:44
#4 0x0007c5b7 in cpSpaceRemoveBody ()
#5 0x0003561d in removePhysicsCallBack ()
#6 0x00081e34 in postStepCallbackSetIter ()
#7 0x00076b67 in cpHashSetEach ()
#8 0x00081683 in cpSpaceStep at /Users/<redacted>/Chipmunk/src/cpSpaceStep.c:398
rocity
 
Posts: 7
Joined: Thu Dec 01, 2011 2:10 pm

Re: cpPostStepCallBack is murdering me

Postby rocity » Thu Dec 01, 2011 2:48 pm

Since space->locked-- is being called and space->locked is still 1, I suppose that means I'm doing something I shouldn't be...?
rocity
 
Posts: 7
Joined: Thu Dec 01, 2011 2:10 pm

Re: cpPostStepCallBack is murdering me

Postby rocity » Thu Dec 01, 2011 4:00 pm

Is it because I am adding the callback in a class other than the class that handles the collisions? It seems like the callbacks are being called before the collision can finish being handled.
rocity
 
Posts: 7
Joined: Thu Dec 01, 2011 2:10 pm

Re: cpPostStepCallBack is murdering me

Postby slembcke » Thu Dec 01, 2011 4:28 pm

I don't know of any bug that would cause the lock count to become unbalanced. However, somebody did run into this issue before because of NSAssertions. Double check the console to make sure that there aren't any assertions happening.

NSAssertion can be set up to behave a number of ways. One of them is to log the message and then throw an exception that is caught by the event loop. The event loop displays the message and continues on it's merry way. The other person that had your issue was triggering an NSAssertion inside of a callback somewhere causing it to never unlock the space again. They didn't notice that there was an assertion message being thrown because it wasn't crashing the program.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: cpPostStepCallBack is murdering me

Postby rocity » Thu Dec 01, 2011 6:28 pm

unfortunately, there's no failed assertions. i have an array of objects and these objects have a method called getRidOfObject, which has a cpSpaceAddPostStepCallback in it to get rid of the object's physics objects. what i'm doing is running a method that gets rid of all the objects, so something like for(Object *object in layer.myobjects) {[object getRidOfObject];} the first object in the array is gotten rid of, but the 2nd object causes chipmunk some issue. any ideas?
rocity
 
Posts: 7
Joined: Thu Dec 01, 2011 2:10 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest

cron