dgVector::Floor() crash

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

dgVector::Floor() crash

Postby JernejL » Mon Dec 02, 2019 3:14 pm

I found another crash, decided to make new thread as old one is a bit big and messy.

This crash happens regularly but i have no idea what causes this as i do not do anything particular to produce it - all i do is run the game and it eventually happens.

screenshot in visual studio: https://i.imgur.com/yZ9wKuT.png

Image

here is call stack and locals:
Code: Select all
>   newton.dll!dgVector::Floor() Line 279   C++
    newton.dll!dgBroadPhaseNode::SetAABB(minBox={...}, maxBox={...}) Line 96   C++
    newton.dll!dgBroadPhase::UpdateBody(body=0x27867f40, threadIndex=1) Line 739   C++
    newton.dll!dgBody::UpdateCollisionMatrix(timestep=0.0166666675, threadIndex=1) Line 262   C++
    newton.dll!dgWorldDynamicUpdate::IntegrateVelocity(cluster=0x189ac1d0, accelTolerance=0.500000000, timestep=0.0166666675, threadID=1) Line 628   C++
    newton.dll!dgWorldDynamicUpdate::ResolveClusterForces(cluster=0x189ac1d0, threadID=1, timestep=0.0166666675) Line 677   C++
    newton.dll!dgWorldDynamicUpdate::CalculateClusterReactionForcesKernel(context=0x1a05fd9c, worldContext=0x18962620, threadID=1) Line 458   C++
    newton.dll!dgThreadHive::dgWorkerThread::RunNextJobInQueue(threadId=1) Line 224   C++
    newton.dll!dgThreadHive::dgWorkerThread::ConcurrentWork(threadId=1) Line 243   C++
    newton.dll!dgThreadHive::dgWorkerThread::Execute(threadId=1) Line 260   C++
    newton.dll!dgThread::dgThreadSystemCallback(threadData=0x189fe3fc) Line 201   C++
    newton.dll!std::_Bind<1,void *,void * (__cdecl*const)(void *),dgThread *>::_Do_call<,0>(_Myfargs={...}, __formal={...}) Line 1149   C++
    newton.dll!std::_Bind<1,void *,void * (__cdecl*const)(void *),dgThread *>::operator()<>() Line 1138   C++
    newton.dll!std::_LaunchPad<std::_Bind<1,void *,void * (__cdecl*const)(void *),dgThread *> >::_Run(_Ln=0x01f4e774) Line 196   C++
    newton.dll!std::_LaunchPad<std::_Bind<1,void *,void * (__cdecl*const)(void *),dgThread *> >::_Go() Line 187   C++
    newton.dll!_Call_func(_Data=0x01f4e774) Line 28   C++
    newton.dll!_callthreadstartex() Line 376   C
    newton.dll!_threadstartex(ptd=0x18a0a918) Line 359   C
    kernel32.dll!@BaseThreadInitThunk@12()   Unknown
    ntdll.dll!__RtlUserThreadStart()   Unknown
    ntdll.dll!__RtlUserThreadStart@8()   Unknown



Local variables:

Code: Select all
+      this   0x23b4f5d0 {m_f=0x23b4f5d0 {956.748413, -632.292908, -2.14749875e+009, 0.000000000} m_i=0x23b4f5d0 {...} ...}   const dgVector *
+      truncated   {m_f=0x23b4f480 {-107374176., -107374176., -107374176., -107374176.} m_i=0x23b4f480 {-858993460, -858993460, ...} ...}   dgVector
+      ret   {m_f=0x23b4f430 {-107374176., -107374176., -107374176., -107374176.} m_i=0x23b4f430 {-858993460, -858993460, ...} ...}   dgVector

Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1500
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: dgVector::Floor() crash

Postby Julio Jerez » Tue Dec 03, 2019 2:46 pm

ok let us go one bug at a time.
the location of the body aabb is rally far away. and simd can't no get that kind of int since it only dealy with 24 bits.
but it it does no matter some else went wrong already and we need to trap what si teh cause.

in this function
void dgBody::IntegrateVelocity (dgFloat32 timestep)

line 313 there is a trace that tells when a body acquires an unreasonable velocity
I edited to cheek for linear speed, but I dis added the assert.

if you um comment the assert then it will stop when the bug happen and we may know what causes it.

Code: Select all
   if ((step2 > err2) || (speed2 > 100.0f) {
      dgTrace (("warning bodies %d v(%f %f %f) w(%f %f %f) with very high velocity or angular velocity, may be unstable\n", m_uniqueID,
               m_omega.m_x, m_omega.m_y, m_omega.m_z, m_veloc.m_x, m_veloc.m_y, m_veloc.m_z));
      //dgAssert(0);
   }

sync to get the change and try that please.
Julio Jerez
Moderator
Moderator
 
Posts: 11048
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests

cron