Libgdx Box2d createfixture crashes vm intermittently

Posted by user45021 on Game Development See other posts from Game Development or by user45021
Published on 2014-04-25T09:44:23Z Indexed on 2014/05/26 22:07 UTC
Read the original article Hit count: 420

Filed under:
|
|

I have a hard to debug problem. I have a Box2D game which creates a wheeled vehicle. I want the vehicle body to reflect when it goes from moving left to moving right. to do this i set a flag in a changelistener on a button and then in update method i destroy and recreate the body facing the other way. it works fine most of the time but if i flip the vehicle several times quickly JVM crashes. no errors nothing in log.

i added system.out.prints and the errors occur in the routine that instantiates the new body and before anything gets deleted/removed so i don't think the UI is trying to access null pointers. and if it was it should throw an error. M the crash seems to be at createFixture statements. but the work most of the first time. I tried debugging but the error doesn't happen much when the flips are slow. in any case createFixture drops fairly quickly into jni.

Is this a Box2D bug? Is GC the issue? From Mission Control I see the GC is collecting on a period of ooh maybe 5s and flipping slower than that mostly works.

how do i debug this?

i am win7 64bit with 64bit at and jdk7 64bit. libgdx-0.9.9 and sometimes libgdx-nightly-20140215.

© Game Development or respective owner

Related posts about java

Related posts about libgdx