[ODE] Fwd: AMD x86_64 dMassCheck() and bNormalizationResult errors

Funky Fred funkyfredmale at hotmail.com
Mon Nov 19 01:18:40 MST 2007


Ok, narrowed it down a bit more. Looks like the body->avel value in dxStepBody is NaN.
I stepped through things a little bit more and narrowed it down to the dxQuickStepper call @868 in quickstep.cpp
If I'm reading the gdb output right (it's getting late). It looks like the dMULTIPLYADD0_331 macro/function is doing it.

gdb output (hopefully this makes sense here):

Breakpoint 5, dxQuickStepper (world=0x60f010, body=0x7ffff6f970e0, nb=1, 
    _joint=, nj=0, stepsize=1) at quickstep.cpp:844
844             for (i=0; iavel
9: body[0]->avel = {0, 0, 0, 0}
....
(gdb) next
847                     for (j=0; jtacc[j] *= stepsize;
11: body[0]->avel = {0, 0, 0, 0}
9: body[0]->avel = {0, 0, 0, 0}
8: body[0] = (dxBody * const) 0x60f680
(gdb) next
255     DECL dMULTIPLYADD0_331(TA *A, const TB *B, const TC *C) { dMULTIPLYOP0_331(A,+=,B,C); }
11: body[0]->avel = {0, 0, 0, 0}                           <-------------------------------------
9: body[0]->avel = {0, 0, 0, 0}                            <-------------------------------------
8: body[0] = (dxBody * const) 0x60f680
(gdb) next
844             for (i=0; iavel = {-nan(0x400000), -nan(0x400000), 0, 0}   <-------------------------------------
9: body[0]->avel = {-nan(0x400000), -nan(0x400000), 0, 0}  <-------------------------------------
8: body[0] = (dxBody * const) 0x60f680
(gdb) bt
#0  dxQuickStepper (world=0x60f010, body=0x7ffff6f970e0, nb=1, 
    _joint=, nj=0, stepsize=1) at quickstep.cpp:844
#1  0x00002b42b3d8e58d in dxProcessIslands (world=0x60f010, stepsize=1, 
    stepper=0x2b42b3d5b890 ) at util.cpp:350
#2  0x000000000040437e in evolve::PhysicsEngine::doPhysics (
    this=0x7ffff6f971d0) at PhysicsEngine.cc:241
#3  0x0000000000409980 in main () at testPhysicsEngine.cc:37

....
ODE INTERNAL ERROR 1: assertion "dVALIDVEC4(b->avel)" failed in dxStepBody() [util.cpp]
(I just dumped the code you had into the function , so this is asset is at:
util.cpp @254 +/- a few lines
  else {
    // the normal way - do an infitesimal rotation
    dReal dq[4];
    dIASSERT(dVALIDVEC4(b->avel));
    dIASSERT(dVALIDVEC4(b->q));
    dWtoDQ (b->avel,b->q,dq);

.....

Hope this helps. I'm off to bed.

cheers,
  -Stu


________________________________
> Date: Sun, 18 Nov 2007 22:20:57 -0800
> From: b.stolk at gmail.com
> To: funkyfredmale at hotmail.com
> Subject: Re: [ODE] Fwd: AMD x86_64 dMassCheck() and bNormalizationResult errors
> CC: ode at ode.org
> 
> Ok, the VALIDVEC macro needed an assert around it, sorry about that.
> Well, we need to find out where the nan's are coming from.
> Just sprinkle some extra asserts around in dxStepBody.
> You can use something like the attached text for this.
> 
>  Bram
> 
> 
> On Nov 18, 2007 8:11 PM, Funky Fred <funkyfredmale at hotmail.com> wrote:
> 
> Looks like NAN (I also added a print statement to make sure my changes were actually happening)
> 
> No source file named util.cpp.
> Breakpoint 1 at 0x2af26a2008db: file util.cpp, line 258.
> [Thread debugging using libthread_db enabled]
> [New Thread 47220667346784 (LWP 15338)]
> gravity: 0,10,0
> before:
> pos 1: 0,10,0
> pos 2: 0,10,0
> size of short: 2
> [Switching to Thread 47220667346784 (LWP 15338)]
> 
> Breakpoint 1, dxStepBody (b=0x60f680, h=-nan(0x400000)) at util.cpp:258
> 258       cout << "Testing quat with dVALIDVEC4" << endl;
> (gdb) next
> 72            return __pf(*this);
> (gdb) display b->q
> 1: b->q = {nan(0x400000), -nan(0x400000), -nan(0x400000), -nan(0x400000)}
> 
> (needless to say, if I let it keep running, I get the same error as before. The assert doesn't appear to trigger)
> 
> changes were like so:
>  // normalize the quaternion and convert it to a rotation matrix
>  cout << "Testing quat with dVALIDVEC4" << endl;
>  dVALIDVEC4( b->q );
>  dNormalize4 (b->q);
> 
> I'm I feeding it funky number that throws it off (that 32 bit machines didn't catch)? Or is this a 64 bit issue?
> Note I'm using the dMassAdjust version (as outlined in the previous mail), which I haven't tried on 32 bit, Should make too much of a difference, though, should it?
> 
> A snippet to refresh:
>    dMass dmass;
>    dMassSetZero( &dmass );
>    dMassAdjust( &dmass, mass );
>    //dmass.mass = mass;
>    dBodySetMass( bodies[name], &dmass );
>    return true;
> 
> Btw, thanks for the quick response! I would have pinged back sooner, but I work on Sundays ...
> 
> -Stu
> 
> ________________________________
>> Date: Sun, 18 Nov 2007 07:58:35 -0800
>> From: b.stolk at gmail.com
>> To: ode at ode.org
>> Subject: [ODE] Fwd: AMD x86_64 dMassCheck() and bNormalizationResult errors
>>
>> a copy to the list as well.
>>
>>
>> On Nov 18, 2007 12:08 AM, Funky Fred> wrote:
>>
>> ODE INTERNAL ERROR 1: assertion "bNormalizationResult" failed in _dNormalize4() [../../include/ode/odemath.h]
>>
>> Program received signal SIGABRT, Aborted.
>> [Switching to Thread 47280432254816 (LWP 8903)]
>> 0x00002b00550a3765 in raise () from /lib/libc.so.6
>> (gdb) bt
>> #0  0x00002b00550a3765 in raise () from /lib/libc.so.6
>> #1  0x00002b00550a51c0 in abort () from /lib/libc.so.6
>> #2  0x00002b00546098f6 in dDebug (num=,
>>    msg=) at error.cpp:102
>> #3  0x00002b005464283a in dxStepBody (b=0x60e680, h=4.59163468e-41)
>>    at ../../include/ode/odemath.h:304
>> #4  0x00002b0054610a6f in dxQuickStepper (world=0x60e010, body=0x7fff566e2830,
>>    nb=2, _joint=, nj=1, stepsize=1) at quickstep.cpp:868
>> #5  0x00002b00546422cd in dxProcessIslands (world=0x60e010, stepsize=1,
>>    stepper=0x2b005460f630 ) at util.cpp:339
>> #6  0x00000000004042fe in evolve::PhysicsEngine::doPhysics (
>>    this=0x7fff566e2920) at PhysicsEngine.cc:240
>> #7  0x0000000000409920 in main () at testPhysicsEngine.cc:37
>>
>>
>>
>> It is this normalization in dxStepBody()
>>
>>   // normalize the quaternion and convert it to a rotation matrix
>>   dNormalize4 (b->q);
>>   dQtoR (b->q,b-> posr.R);
>>
>> It means that the quaternion calculated by dxStepBody() is 0,0,0,0
>> Or just maybe it is trying to use NaN values?
>> Please put in line 254 of util.cpp the following assert macro:
>>   dVALIDVEC4(b->q);
>> And let us know if it is triggered or not.
>>
>>
>>   Bram
>>
>>
>> --
>> Zapp: Captain's log, stardate...er..
>> Kif: Ohhh. April 13th.
>> Zapp: April 13th. Point 2.
> 
> _________________________________________________________________
> You keep typing, we keep giving. Download Messenger and join the i'm Initiative now.
> http://im.live.com/messenger/im/home/?source=TAGLM
> 
> 
> 
> --
> Zapp: Captain's log, stardate...er..
> Kif: Ohhh. April 13th.
> Zapp: April 13th. Point 2.

_________________________________________________________________
Put your friends on the big screen with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_102007


More information about the ODE mailing list