Hello, I was wondering if anyone is experiencing issues with chipmunk2d apps crashing in the active2staticIter function inside of cpSpace.c. It appears that a dangling pointer being passed into the function and causing the crash. Below is a stack trace of the relevant chipmunk functions:
0 0x0000caf4 active2staticIter (cpSpace.c:437)
1 0x0000d748 eachHelper (cpSpaceHash.c:324)
2 0x0000b3e6 cpHashSetEach (cpHashSet.c:192)
3 0x0000d786 cpSpaceHashEach (cpSpaceHash.c:334)
4 0x0000cc52 cpSpaceStep (cpSpace.c:479)
My application is actively removing shapes/bodies from the space from inside collisions (the shapes/bodies are being removed, not free'd - they are added back in later) . What I assume is happening is cpSpaceStep is being called, a collision happens and a shape is removed from the space, and so the pointer to that shape passed into active2staticIter is no longer valid. Does this sound about right? If so does anyone have any solutions or work arounds? I can post code if necessary. Thanks!