Debugging update methods

I'm chasing down a lockup which I think is in JME's update routines. There is, unfortunately, no generated exception or condition that stops the game, just a solid lockup. Audio continues playing, the window stays open, but the game never leaves StandardGame.update(). I'm using JMEPhysics, the error occurs on collisions and if I change one of the colliding objects' shape to a sphere then the crash goes away. I'd like to provide information to help others fix this, but am not clear on how.

What's the best way to debug this, given a limitation of using console tools (jdb, at the moment)? I know what triggers the bug, so I could set a breakpoint, but given that update routines are called 100 or more times/second, that's an awful amount of continues, even if I catch things a half second or so before the crash conditions. Same with telling jdb to trace method execution. AFAIK I still need to manually continue, though I could be wrong about this.

What I'd really like is to have the JVM dump a report of method calls, instructions, etc. Then I could go through the report, determine which method in the framework is locking up, then file a more useful bug report than "It isn't making it out of the update() method!" which is rather useless. :slight_smile: My debugging experience is limited mostly to single-threaded apps and gdb. Is there something I could do to get a report like this? I know there are obscure JVM options for profiling, so perhaps something similar exists. Or what else could I try to get something more substantial? Everything is compiled in debug mode, and I'd rather avoid littering JME's code with printlns until I chase the error into whatever physics subsystem call is hanging it.

Logging is really one of the best way to handle multithreaded debugging.  You can't really operate in debug mode most of the time because most threading issues are the result of race conditions and when you are pausing a thread you mess up the reproducibility of the circumstances of the bug.


I haven't written a line of java in about five years, and I know very close to nothing about 3D in general. So, this suggestion could be downright awful. On the other hand, I'm also hoping you'll try it in the jME context and see if it has any value.

Omniscient Debugging:

If this post turns out to be unintentionally hilarious, please forgive me when you're able to pick yourself up off the floor :).