I definitely have asserts on. This is a full debug build.
Here's another error I'm hitting when trying to get a reproduction case. Perhaps this might shed some light on how things are going wrong (odd behavior like this is oftentimes related):
"Aborting due to Chipmunk error: This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback."
This seems to be caused during a call to cpSpaceRemoveShape. The cpAssertSpaceUnlocked call is failing. The space pointer seems to be okay, but the lock variable is set to 2. This seems to be possible only if I'm reentering the library. My callstack does not show that I'm reentering the library.
Here's my stack:
Code: Select all
_abort() + 0x83 bytes
cpMessage(const char * condition, const char * file, int line, int isError, int isHardError, const char * message, ...) Line 49
cpSpaceRemoveShape(cpSpace * space, cpShape * shape) Line 370 + 0x29 bytes
AnimatedPhysicsObject::RemoveShapeFromSpace(cpShape * TheShape, cpSpace * TheSpace) Line 196 + 0xd bytes
AnimatedPhysicsObject::OnRemoveFromPhysicsLayer() Line 179
PhysicsLayer::InternalRemoveObject(PhysicsObject * TheObject) Line 225 + 0xf bytes
PhysicsLayer::RemoveObject(PhysicsObject * TheObject) Line 214
PhysicsLayer::InternalRecycleObjects() Line 180
PhysicsLayer::Update() Line 157
UpdateManager<SceneObject2D>::Update() Line 152 + 0x13 bytes
SceneLayer2D::Update() Line 82
GameLevel::Update() Line 295
UpdateManager<SceneObject2D>::Update() Line 152 + 0x13 bytes
SceneLayer2D::Update() Line 82
UpdateManager<SceneObject2D>::Update() Line 152 + 0x13 bytes
SceneLayer2D::Update() Line 82
UpdateManager<SceneObject2D>::Update() Line 152 + 0x13 bytes
SceneLayer2D::Update() Line 82
UpdateManager<SceneObject2D>::Update() Line 152 + 0x13 bytes
SceneGraph2D::Update() Line 53
Rage::Update() Line 88 + 0x15 bytes
Game::Update() Line 52
main(int argc, const char * * argv) Line 342 + 0x15
Here's my space watch dump:
Code: Select all
space 0x0ad84038 {iterations=0x0000000a gravity={...} damping=0.94999999999999996 ...}
iterations 0x0000000a
gravity {x=0.00000000000000000 y=400.00000000000000 }
damping 0.94999999999999996
idleSpeedThreshold 0.00000000000000000
sleepTimeThreshold 1.0000000000000000
collisionSlop 0.10000000149011612
collisionBias 0.0017970074436457143
collisionPersistence 0x00000003
enableContactGraph 0x00000000
data 0x0ad7d830
staticBody 0x0ad840f0 {velocity_func=0x064ecba8 position_func=0x064e6320 m=1.#INF000000000000 ...}
stamp 0x0000e4c4
curr_dt 0.0083007812500000000
bodies 0x0ad5fe60 {num=0x0000002f max=0x00000100 arr=0x0b02efd0 }
rousedBodies 0x0ad60808 {num=0x00000000 max=0x00000040 arr=0x0b0e0be8 }
sleepingComponents 0x0ad602f8 {num=0x000000a7 max=0x00000100 arr=0x0b018f18 }
staticShapes 0x0ad44d40 {klass=0x06e1e570 bbfunc=0x067b3de0 staticIndex=0x00000000 ...}
activeShapes 0x0ad44f00 {klass=0x06e1e570 bbfunc=0x067b3de0 staticIndex=0x0ad44d40 ...}
arbiters 0x0ad60910 {num=0x00000022 max=0x00000100 arr=0x0b02ebc8 }
contactBuffersHead 0x0ae76210 {stamp=0x0000e4c4 next=0x0b026c30 numContacts=0x0000002c }
cachedArbiters 0x0ad83bf8 {entries=0x00000025 size=0x00000185 eql=0x067b3e10 ...}
pooledArbiters 0x0ad42970 {num=0x000001cf max=0x00000200 arr=0x0ae75a08 }
constraints 0x0ad54e90 {num=0x00000000 max=0x00000010 arr=0x0adfae48 }
allocatedBuffers 0x0ad5fa78 {num=0x0000000a max=0x00000010 arr=0x0afaea98 }
locked 0x00000002
collisionHandlers 0x0ad65b28 {entries=0x0000000c size=0x0000000d eql=0x067b3ea0 ...}
defaultHandler {a=0x00000000 b=0x00000000 begin=0x067b3aa0 ...}
skipPostStep 0x00000000
postStepCallbacks 0x0ad30410 {num=0x00000000 max=0x00000004 arr=0x0ad47808 }
_staticBody {velocity_func=0x064ecba8 position_func=0x064e6320 m=1.#INF000000000000 ...}
Sorry for the massive dump.
Can you think of any way this could be occurring?
steve