[ODE] ODE / Mac OS X Crash

Nate W coding at natew.com
Fri Apr 5 14:29:01 2002


This sounds an awful lot like the crashes I was getting under Windows, due
to ODE's use of stack (rather than heap) allocation.  I had code working
on Linux (because Linux grows the stack automatically to satisfy the
allocation request), but failing on Win 2k (because the stack size is
fixed under Win 2k).

Do you know if OS X will grow the stack automatically?  If there's a
linker option to set the stack size, try doubling or tripling it from the
current size.  When you have a lot of contacts, ODE needs a lot of memory
to process them, and that memory is allocated from the stack.  So: lots of
objects -> lots of contacts -> large alloca requests -> stack exhaustion
-> failed request -> crash.

I could be barking up the wrong tree here, but I was seeing crashes in the
same function under the similar circumstances with similar results (no
crash) on Linux, so I think it's worth a look.

On Fri, 5 Apr 2002, Kevin Reid wrote:

>   The simulation consists of NUMBODIES unit cubes or spheres dropped
>   onto a fixed xz plane, with gravity in the -y direction and damping to
>   produce a terminal velocity effect. The x and z location of the bodies
>   does not noticeably affect the crashing behavior.
>   
>   Operating systems: 
>     Mac OS X 10.1.x: crashes
>     x86 SuSE Linux: stable
>  
>   My results with different numbers of boxes:
>   <= 40: stable
>   41-59: depends on how long you let it run
>   >= 60: SIGSEGV before all the objects fall
>  
>   Crash log contains:
>   
>   Thread 0 Crashed:
>    #0   0x0001a028 in dSolveLCP(int, double *, double *, double *, double *, int, double *, double *, int *)
>    #1   0x000047b4 in processIslands(dxWorld *, double)