[ODE] crash prevention?
Nate W
coding at natew.com
Mon Jul 14 20:46:02 2003
On Tue, 15 Jul 2003 ray@his.atr.co.jp wrote:
> I am porting to ODE, and want to ask advice on a certain problem.
> Under MathEngine, some creatures explode, but these explosions
> do not crash the software. Under ODE, the software frequently
> crashes, always in exactly the same place (see below). I need
> to be able to "handle" this error so as to prevent the crash,
> so that I can generate and select large numbers of creatures
> in a genetic algorithm.
Your stack trace looks familiar, I think it's about what I got when my
system matrix exceeded Win32's maximum stack size. You can up this to
about 8,000,000 bytes with linker option (larger values will be
ignored). I suspect that "large numbers of creatures" is your
problem. If you really want large numbers, you have two options - port to
an OS other than Win32 (e.g. Linux), or run more iterations with fewer
creatures per iteration.
> Any advice on how to catch and handle this error before the crash?
No, but wrapping dWorldStep in 'try { dWorldStep() } catch (...) {}'
should at least prevent the application from crashing. When that happens,
perhaps you could pare down your population somehow. Remove a couple, or
split it in half and run two simulations in series, something like that.
Does anyone know if dWorldStepFast() uses less stack for complex systems?
I haven't tested with it, but it seems like it might.
--
Nate Waddoups
Redmond WA USA
http://www.natew.com