I create iOS app with Cocos2d v 1.0.1 and Box2d (cocos2d + box2d template). On iPad my app works ok On iPhone 4,4s ( ios versions 5.0.1 , 6.0 , not tested on other iPhones/firmwares) I got EXC_BAD_ACCESS at beginning of my game (after short time of playing) .
myActor.position = CGPointMake( b->GetPosition().x * PTM_RATIO, b->GetPosition().y * PTM_RATIO );
I analyzed state of b and Box2d world, and it looks like the bodies list of world is corrupted. Pointer to b contains b2PolygonShape, not a b2Body (I see that in Variables View in Xcode). Sometimes (also only on iPhones), my game begins to behave unexpectedly. I set breakpoints in my update method and realized that Box2d world's body list contatins only one body (but at previous update world contains many bodies, and visually they are on screen on current update).
I checked code of my game, and cannot find the error, or reason of such behavior.
I tried to use Analyze feature of Xcode, change Box2d version, and some other things.
I couldn't solve this problem for now.
What approaches should I use to debug this crash?
What can I do to research and solve it?