unrecoverable stack overflow

An unrecoverable stack overflow has occurred.

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_STACK_OVERFLOW (0xc00000fd) occurred at PC=0xC889724
Function=Java_net_java_dev_odejava_ode_OdeJNI_SWIGdBallJointTodJoint+0xB1F4
Library=odejava.dll

I get this using the stepfast method when I have a lot of, around 184, boxes stacked on top of each other.

How can I count the number of ContactJoints created or increase the stack.

I assume you are using windows dll, this is ODE related issue, check “/Stack:num” option for the compiler. This can occur when you have masses of simultaneous collisions happening. In other words, there can be plenty of objects around but many simultaneous collisions can be a problem.

Check http://opende.sourceforge.net/ode-latest-userguide.html for more information.

Here’s a snippet from Ode’s documentation:

12.11. The Windows version of ODE crashes with large systems

ODE requires stack space roughly on the order of O(n)+O(m2), where n is the number of bodies and m is the sum of all the joint constraint dimensions. If m is large, this can be a lot of space!

Unix-like operating systems typically allocate stack space as it is needed, with an upper limit that might be in the hundreds of Mb. Windows compilers normally allocate a much smaller stack. If you experience crashes when running large systems, try increasing the stack size. For example, the MS VC++ command line compiler accepts the /Stack:num flag to set the upper limit.

Yes, I’m using the windows ODE. I used the dll that you provided. Do I have to recompile it to increase the stack?

And is it possible to count the number of collisions or Contact Joints created? This will probably indicate why I get a stack overflow error.

I am releasing new Odejava 0.2 with huge changes (full support of ODE API, added also higher level API). I try to recompile this DLL with bigger stack option, hope you can wait a day or two :slight_smile:

Collision checking is done still at C layer, it is most effective way but also most inconvinient. TODO contains adding Java collision callback routine, but this is not yet at Odejava. So currently you need to recompile whole library if you want to access collision information.

After 0.2 is out, the todo for Java callback functions priority will raise. This is the ideal solution for most users.

Thanks. :slight_smile:

Well, it took a bit more than couple days but now it’s done :slight_smile:
Check out the cvs, odejava/lib/win32 contains now a DLL that has increased stack space. Normal stackspace is 1Mb, this DLL has 2Mb initial, and maximum of 4Mb. I have tested this with about 200 concurrent collisions with boxes stacked on each other.