[ODE] Bug in dxQuickStepper ?

Marco Grubert mgrubert at conitec.net
Wed Mar 16 15:59:12 MST 2005


Hello,

When removing joints I get a stack overwrite in dxQuickStepper. Here are the 
relevant sections:

int iSaved=0;  // for debug purposes

void dxQuickStepper (dxWorld *world, dxBody * const *body, int nb,
dxJoint * const *_joint, int nj, dReal stepsize)
{
(...)
// create the row offset array
int m = 0;
int *ofs = (int*) alloca (nj*sizeof(int));
for (i=0; i<nj; i++) {
  ofs[i] = m;
  m += info[i].m;
}
iSaved= ofs[0]; // let's backup this value
(...)
Jinfo.J1l = J + ofs[i]*12;
Jinfo.J1a = Jinfo.J1l + 3;
Jinfo.J2l = Jinfo.J1l + 6;
Jinfo.J2a = Jinfo.J1l + 9;
Jinfo.c = c + ofs[i];
Jinfo.cfm = cfm + ofs[i];
Jinfo.lo = lo + ofs[i];
Jinfo.hi = hi + ofs[i];
Jinfo.findex = findex + ofs[i];
     dIASSERT( iSaved== ofs[0] ); // still good here
joint[i]->vtable->getInfo2 (joint[i],&Jinfo);
// adjust returned findex values for global index numbering
     dIASSERT( iSaved== ofs[0] ); // Asserts here !
(...) 



More information about the ODE mailing list