[ODE] dMessage crashes my system

Santi Ontañón santi.ontanon at terra.es
Mon Mar 29 17:13:51 MST 2004


Hi everybody,

I'm new to ODE, and I'm having some problems. I use ODE 0.039 compiled 
using VC++ 6.0 for windows (I use Windows ME). After several sucessful 
trials with some cubes and joints, I've found a scenario where ODE 
crashes my system. I've traced the problem, and the program crashes in 
this point of the code in the file lcp.cpp:

...
    // if s <= 0 then we've got a problem. if we just keep going then
    // we're going to get stuck in an infinite loop. instead, just cross
    // our fingers and exit with the current solution.
    if (s <= 0) {
      dMessage (d_ERR_LCP, "LCP internal error, s <= 0 (s=%.4e)",s);
      if (i < (n-1)) {
        dSetZero (x+i,n-i);
        dSetZero (w+i,n-i);
      }
      goto done;
    }
...

It exactly crashes when callind "dMessage", and in more detail, it 
crashes inside dMessage in this function (in file error.cpp):

static void printMessage (int num, const char *msg1, const char *msg2,
              va_list ap)
{
  fflush (stderr);
  fflush (stdout);
  if (num) fprintf (stderr,"\n%s %d: ",msg1,num);
  else fprintf (stderr,"\n%s: ",msg1);
  vfprintf (stderr,msg2,ap);
  fprintf (stderr,"\n");
  fflush (stderr);
}

The crash occurs when calling "fflush(stderr)".
Anyone knows how to solve this problem? I'm tempted to simply delete the 
call do "dMessage", but I'd like a "neater" solution!

thanks in advance

santi



More information about the ODE mailing list