Re: Fwd: AMD x86_64 dMassCheck() and bNormalizationResult errors
Funky Fred <[email protected]> Mon, 19 Nov 2007 08:18:40 +0000
| Newsgroups | gmane.comp.lib.ode |
|---|---|
| Message-ID | <[email protected]> |
Ok, narrowed it down a bit more. Looks like the body->avel value in dxStepB=
ody is NaN.
I stepped through things a little bit more and narrowed it down to the dxQu=
ickStepper 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=3D0x60f010, body=3D0x7ffff6f970e0, nb=
=3D1, =
_joint=3D, nj=3D0, stepsize=3D1) at quickstep.cpp:844
844 for (i=3D0; iavel
9: body[0]->avel =3D {0, 0, 0, 0}
....
(gdb) next
847 for (j=3D0; jtacc[j] *=3D stepsize;
11: body[0]->avel =3D {0, 0, 0, 0}
9: body[0]->avel =3D {0, 0, 0, 0}
8: body[0] =3D (dxBody * const) 0x60f680
(gdb) next
255 DECL dMULTIPLYADD0_331(TA *A, const TB *B, const TC *C) { dMULTIPLY=
OP0_331(A,+=3D,B,C); }
11: body[0]->avel =3D {0, 0, 0, 0} <-------------=
------------------------
9: body[0]->avel =3D {0, 0, 0, 0} <-------------=
------------------------
8: body[0] =3D (dxBody * const) 0x60f680
(gdb) next
844 for (i=3D0; iavel =3D {-nan(0x400000), -nan(0x400000), 0, 0=
} <-------------------------------------
9: body[0]->avel =3D {-nan(0x400000), -nan(0x400000), 0, 0} <-------------=
------------------------
8: body[0] =3D (dxBody * const) 0x60f680
(gdb) bt
#0 dxQuickStepper (world=3D0x60f010, body=3D0x7ffff6f970e0, nb=3D1, =
_joint=3D, nj=3D0, stepsize=3D1) at quickstep.cpp:844
#1 0x00002b42b3d8e58d in dxProcessIslands (world=3D0x60f010, stepsize=3D1, =
stepper=3D0x2b42b3d5b890 ) at util.cpp:350
#2 0x000000000040437e in evolve::PhysicsEngine::doPhysics (
this=3D0x7ffff6f971d0) 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: [email protected]
> To: [email protected]
> Subject: Re: [ODE] Fwd: AMD x86_64 dMassCheck() and bNormalizationResult =
errors
> CC: [email protected]
> =
> 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 <[email protected]> wrote:
> =
> Looks like NAN (I also added a print statement to make sure my changes we=
re 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=3D0x60f680, h=3D-nan(0x400000)) at util.cpp:2=
58
> 258 cout << "Testing quat with dVALIDVEC4" << endl;
> (gdb) next
> 72 return __pf(*this);
> (gdb) display b->q
> 1: b->q =3D {nan(0x400000), -nan(0x400000), -nan(0x400000), -nan(0x400000=
)}
> =
> (needless to say, if I let it keep running, I get the same error as befor=
e. 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 di=
dn'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, th=
ough, should it?
> =
> A snippet to refresh:
> dMass dmass;
> dMassSetZero( &dmass );
> dMassAdjust( &dmass, mass );
> //dmass.mass =3D 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: [email protected]
>> To: [email protected]
>> Subject: [ODE] Fwd: AMD x86_64 dMassCheck() and bNormalizationResult err=
ors
>>
>> 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 _dNorma=
lize4() [../../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=3D,
>> msg=3D) at error.cpp:102
>> #3 0x00002b005464283a in dxStepBody (b=3D0x60e680, h=3D4.59163468e-41)
>> at ../../include/ode/odemath.h:304
>> #4 0x00002b0054610a6f in dxQuickStepper (world=3D0x60e010, body=3D0x7ff=
f566e2830,
>> nb=3D2, _joint=3D, nj=3D1, stepsize=3D1) at quickstep.cpp:868
>> #5 0x00002b00546422cd in dxProcessIslands (world=3D0x60e010, stepsize=
=3D1,
>> stepper=3D0x2b005460f630 ) at util.cpp:339
>> #6 0x00000000004042fe in evolve::PhysicsEngine::doPhysics (
>> this=3D0x7fff566e2920) 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 Init=
iative now.
> http://im.live.com/messenger/im/home/?source=3DTAGLM
> =
> =
> =
> --
> 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=AE + Windows Live=99.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=3DTXT_TAGLM_C=
PC_MediaCtr_bigscreen_102007