[ODE] RE: valgrind memcheck with ode

Daniel Marbach daniel.marbach at epfl.ch
Fri Dec 3 23:26:33 MST 2004


I had the same problem. After several hours of runing my genetic algorithm it
generally crashed. I also got weird error messages from deep within ODE - in my
case limited stack size was the problemo.

Since I increased the stack size I didn't have a single crash (I use a linker
flag -stack_size, but I think it is specific for Mac).

Refer also to the thread "Rare segmentation faults in dSolveLCP" from last
month.

If you can't fix your problem by increasing the stack size catch the Signal
that's generated by your error and save your population to a file - at least you
won't loose your results and you could recover by restarting from that
population:

// to register your signal handler
if (signal(SIGSEGV, signalHandler) == SIG_ERR)
  cout << "ERROR: No recovery from segmentation faults will be possible!" <<
endl;

// your signal handler
void signalHandler(int signo) {
   ... save your population to a file ...
}


PS: THANKS ADAM, for your reply on the segmentation faults:

>> Sure could be, this is very much a FAQ (and I'm fairly sure it's
>> covered in the manual...)

You were right ;)
It's in the manual


ORIGINAL MESSAGE:

I'm using ODE (v.0.5) to simulate bipeds, evolving locomotion control
programs with Linear GP.
The simulations run for quite some time (between 24hrs and a week of real
time) on a Pentium IV class PC (with Win XP pro sp2, MSVC 6.0). Now, some of
the runs crashes unexpectedly after some time (usually more than a couple of
hours), and I'm not able to figure out why. Because of this, I turned into
Valgrind. Running Valgrind memcheck (under Suse 9.0), with one of my
programs gave the following complaints:

==2056==
==2056== Use of uninitialised value of size 8
==2056==    at 0x805610E: swapProblem(double**, double*, double*, double*,
double*, double*, int*, int*, int*, int, int, int, int, int) (in
/home/krister/041203_1/SEvHumS.exe)
==2056==    by 0x3F5273F4: ???
==2056==

now, the 'swapProblem' function is not within my code, but resides in the
ode package, in the lcp.cpp file, under
C:\ode-0.5\ode\src\

Is this some kind of "normal" behavior?

Don't know if this could be harmful or not, or if it could be related to my
crashing problems.

I got no complaints from valgrind about my own code, however...

Does anyone on the list have a clue about this?


More information about the ODE mailing list