Crash in NewtonUpdate() :(

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Crash in NewtonUpdate() :(

Postby Marc » Tue Nov 24, 2009 8:31 am

Hmm, this issue doesn't seem to be completely resolved for me after all. Sometimes I still get this crash, but I can't reproduce it by just moving so many units on one spot, but the stacktrace is similar. There is no user collision in there anymore:

Code: Select all
>   newton.dll!dgCollisionMesh::dgCollisionConvexPolygon::DistanceToOrigen(const dgMatrix & matrix={...}, const dgVector & scale={...}, float radius=1.0000000, dgVector & out={...})  Line 589 + 0x13 bytes   C++
    newton.dll!dgWorld::CalculatePolySoupToElipseContactsDescrete(dgCollisionParamProxi & proxi={...})  Line 7352 + 0x2d bytes   C++
    newton.dll!dgWorld::CalculateConvexToNonConvexContacts(dgCollisionParamProxi & proxi={...})  Line 8380   C++
    newton.dll!dgWorld::ConvexContacts(dgCollidingPairCollector::dgPair * const pair=0x21ba9f30, dgCollisionParamProxi & proxi={...})  Line 1741 + 0xa bytes   C++
    newton.dll!dgWorld::CalculateContacts(dgCollidingPairCollector::dgPair * const pair=0x21ba9f30, float timestep=0.016000001, int threadIndex=0)  Line 1982   C++
    newton.dll!dgBroadPhaseCalculateContactsWorkerThread::ThreadExecute()  Line 911   C++
    newton.dll!dgBroadPhaseCollision::UpdateContacts(float timestep=0.016000001, bool collisioUpdate=false)  Line 1690   C++
    newton.dll!dgWorld::Update(float timestep=0.016000001)  Line 702   C++
    newton.dll!Newton::UpdatePhysics(float timestep=0.016000001)  Line 115   C++
    [External Code]   
    Client.exe!CUPhysics::Iterate() Line 306   C++


yellow arrow at
007C898E fld dword ptr [ecx]
Code: Select all
--- c:\newton_200\3dlib\sdk\physics\dgcollisionmesh.cpp ------------------------
007C88B0  push        ebp 
007C88B1  mov         ebp,esp
007C88B3  and         esp,0FFFFFFF0h
007C88B6  sub         esp,54h
007C88B9  fld         dword ptr [__real@60ad78ec (832518h)]
007C88BF  push        ebx 
007C88C0  fst         dword ptr [esp+14h]
007C88C4  push        esi 
007C88C5  mov         esi,ecx
007C88C7  mov         ecx,dword ptr [esi+830h]
007C88CD  mov         edx,dword ptr [esi+82Ch]
007C88D3  mov         eax,dword ptr [esi+838h]
007C88D9  push        edi 
007C88DA  mov         edi,dword ptr [ecx]
007C88DC  imul        edi,edx
007C88DF  fld         dword ptr [eax+edi*4]
007C88E2  fld         dword ptr [eax+edi*4+4]
007C88E6  fld         dword ptr [eax+edi*4+8]
007C88EA  lea         eax,[eax+edi*4]
007C88ED  mov         edi,dword ptr [matrix]
007C88F0  mov         eax,dword ptr [scale]
007C88F3  lea         ebx,[esi+120h]
007C88F9  fld         dword ptr [edi]
007C88FB  fmul        st,st(3)
007C88FD  fld         dword ptr [edi+20h]
007C8900  fmul        st,st(2)
007C8902  faddp       st(1),st
007C8904  fld         dword ptr [edi+10h]
007C8907  fmul        st,st(3)
007C8909  faddp       st(1),st
007C890B  fadd        dword ptr [edi+30h]
007C890E  fld         dword ptr [edi+24h]
007C8911  fmul        st,st(2)
007C8913  fld         dword ptr [edi+14h]
007C8916  fmul        st,st(4)
007C8918  faddp       st(1),st
007C891A  fld         st(4)
007C891C  fmul        dword ptr [edi+4]
007C891F  faddp       st(1),st
007C8921  fadd        dword ptr [edi+34h]
007C8924  fxch        st(2)
007C8926  fmul        dword ptr [edi+28h]
007C8929  fxch        st(3)
007C892B  fmul        dword ptr [edi+18h]
007C892E  faddp       st(3),st
007C8930  fld         dword ptr [edi+8]
007C8933  fmulp       st(4),st
007C8935  fxch        st(2)
007C8937  faddp       st(3),st
007C8939  fxch        st(2)
007C893B  fadd        dword ptr [edi+38h]
007C893E  fld         dword ptr [eax]
007C8940  fmulp       st(2),st
007C8942  fxch        st(1)
007C8944  fstp        dword ptr [esp+20h]
007C8948  mov         edx,dword ptr [esp+20h]
007C894C  fld         dword ptr [eax+4]
007C894F  fmulp       st(2),st
007C8951  fxch        st(1)
007C8953  fstp        dword ptr [esp+24h]
007C8957  fmul        dword ptr [eax+8]
007C895A  mov         dword ptr [ebx],edx
007C895C  mov         edx,dword ptr [esp+24h]
007C8960  mov         dword ptr [ebx+4],edx
007C8963  fstp        dword ptr [esp+28h]
007C8967  mov         edx,dword ptr [esp+28h]
007C896B  fldz             
007C896D  mov         dword ptr [ebx+8],edx
007C8970  fst         dword ptr [esp+2Ch]
007C8974  mov         edx,dword ptr [esp+2Ch]
007C8978  mov         dword ptr [ebx+0Ch],edx
007C897B  mov         edx,dword ptr [ecx+4]
007C897E  imul        edx,dword ptr [esi+82Ch]
007C8985  mov         ecx,dword ptr [esi+838h]
007C898B  lea         ecx,[ecx+edx*4]
007C898E  fld         dword ptr [ecx]
007C8990  fld         dword ptr [ecx+4]
007C8993  fld         dword ptr [ecx+8]
007C8996  fld         dword ptr [edi]
007C8998  fmul        st,st(3)
007C899A  fld         dword ptr [edi+20h]
007C899D  fmul        st,st(2)
007C899F  faddp       st(1),st
007C89A1  fld         dword ptr [edi+10h]
007C89A4  fmul        st,st(3)
007C89A6  faddp       st(1),st
007C89A8  fadd        dword ptr [edi+30h]
007C89AB  fld         dword ptr [edi+24h]
007C89AE  fmul        st,st(2)
007C89B0  fld         dword ptr [edi+14h]
007C89B3  fmul        st,st(4)
007C89B5  faddp       st(1),st
007C89B7  fld         st(4)
007C89B9  fmul        dword ptr [edi+4]
007C89BC  faddp       st(1),st
007C89BE  fadd        dword ptr [edi+34h]
007C89C1  fld         dword ptr [edi+8]
007C89C4  fmulp       st(5),st
007C89C6  fxch        st(2)
007C89C8  fmul        dword ptr [edi+28h]
007C89CB  faddp       st(4),st
007C89CD  fxch        st(2)
007C89CF  fmul        dword ptr [edi+18h]
007C89D2  faddp       st(3),st
007C89D4  fxch        st(2)
007C89D6  fadd        dword ptr [edi+38h]
007C89D9  fld         dword ptr [eax]
007C89DB  fmulp       st(2),st
007C89DD  fxch        st(1)
007C89DF  fstp        dword ptr [esp+20h]
007C89E3  mov         ecx,dword ptr [esp+20h]
007C89E7  fxch        st(1)
007C89E9  fmul        dword ptr [eax+4]
007C89EC  fstp        dword ptr [esp+24h]
007C89F0  mov         edx,dword ptr [esp+24h]
007C89F4  fmul        dword ptr [eax+8]
007C89F7  mov         dword ptr [esi+130h],ecx
007C89FD  mov         dword ptr [esi+134h],edx
007C8A03  fstp        dword ptr [esp+28h]
007C8A07  mov         ecx,dword ptr [esp+28h]
007C8A0B  mov         dword ptr [esi+138h],ecx
007C8A11  fst         dword ptr [esp+2Ch]
007C8A15  mov         edx,dword ptr [esp+2Ch]
007C8A19  fst         dword ptr [esp+50h]
007C8A1D  mov         ecx,2
007C8A22  cmp         dword ptr [esi+820h],ecx
007C8A28  fst         dword ptr [esp+54h]
007C8A2C  fst         dword ptr [esp+58h]
007C8A30  mov         dword ptr [esi+13Ch],edx
007C8A36  fst         dword ptr [esp+5Ch]
007C8A3A  mov         dword ptr [esp+14h],ecx
007C8A3E  fst         dword ptr [esp+20h]
007C8A42  fst         dword ptr [esp+24h]
007C8A46  fst         dword ptr [esp+28h]
007C8A4A  fst         dword ptr [esp+2Ch]
007C8A4E  jle         dgCollisionMesh::dgCollisionConvexPolygon::DistanceToOrigen+2EAh (7C8B9Ah)
007C8A54  fstp        st(1)
007C8A56  lea         ecx,[esi+140h]
007C8A5C  fstp        dword ptr [esp+3Ch]
007C8A60  mov         dword ptr [esp+18h],ecx
007C8A64  jmp         dgCollisionMesh::dgCollisionConvexPolygon::DistanceToOrigen+1C5h (7C8A75h)
007C8A66  jmp         dgCollisionMesh::dgCollisionConvexPolygon::DistanceToOrigen+1C0h (7C8A70h)
007C8A68  lea         esp,[esp]
007C8A6F  nop             
007C8A70  mov         eax,dword ptr [scale]
007C8A73  fstp        st(0)
007C8A75  mov         edx,dword ptr [esi+830h]
007C8A7B  mov         ecx,dword ptr [esp+14h]
007C8A7F  mov         edx,dword ptr [edx+ecx*4]
007C8A82  imul        edx,dword ptr [esi+82Ch]
007C8A89  mov         ecx,dword ptr [esi+838h]
007C8A8F  lea         ecx,[ecx+edx*4]
007C8A92  fld         dword ptr [ecx]
007C8A94  fld         dword ptr [ecx+4]
007C8A97  fld         dword ptr [ecx+8]
007C8A9A  fld         st(0)
007C8A
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Crash in NewtonUpdate() :(

Postby Julio Jerez » Wed Nov 25, 2009 10:34 am

one bug at a time
I sent you the newer SDK, try that and see if you can get the crash.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in NewtonUpdate() :(

Postby Marc » Wed Nov 25, 2009 12:18 pm

I just realized, I completely mixed up some versions of newton.dll and serialized newton collision in different directories. I think I upgraded everything and reconverted everything to the last version you sent me and it seems to work now - and I just get the info that you fixed the bouncing issue by releasing another new version of the sdk so I'll do all that once again ...

I vote for some return value of newton's deserialization function in case the serialization protocol version is incorrect ... :)
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Crash in NewtonUpdate() :(

Postby JernejL » Wed Nov 25, 2009 2:45 pm

Marc wrote:I vote for some return value of newton's deserialization function in case the serialization protocol version is incorrect ... :)


That would be a great idea, games could then detect version change and rebuild the serialized models cache, right now i do all this manually whenever i upgrade to new dll version.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Crash in NewtonUpdate() :(

Postby Julio Jerez » Wed Nov 25, 2009 2:56 pm

But this is very simple.
The serialization funtions file support are controll be the app.
All you need to do is to write Check sum and teh file dependency before you serialize the data.
then you can just comple the Check sum to the and if it does no match just re serialize.
I do not see hwo thes is a problem.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in NewtonUpdate() :(

Postby JernejL » Wed Nov 25, 2009 3:41 pm

Julio Jerez wrote:But this is very simple.
The serialization funtions file support are controll be the app.
All you need to do is to write Check sum and teh file dependency before you serialize the data.
then you can just comple the Check sum to the and if it does no match just re serialize.
I do not see hwo thes is a problem.


The problem is, you need to serialize first to get another checksum to compare cached data with real one.. which kinda defeats the point of serialization - speed.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Crash in NewtonUpdate() :(

Postby Julio Jerez » Wed Nov 25, 2009 4:17 pm

I see, woudl it be a solution if teh Funtion NewtonGetVerstion was update in each Beta to returns the Beta Version.

the all you have to do is write the Version with the serialized shape.
then in deserialize you compared Read the version and compered to NewtonGetVersion.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in NewtonUpdate() :(

Postby JernejL » Wed Nov 25, 2009 5:03 pm

that would probably be fine too :)
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Crash in NewtonUpdate() :(

Postby Marc » Wed Nov 25, 2009 6:09 pm

Does the serialization protocol change often?
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Crash in NewtonUpdate() :(

Postby JernejL » Wed Nov 25, 2009 6:34 pm

Marc wrote:Does the serialization protocol change often?


It does randomly.. every few beta revisions.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Crash in NewtonUpdate() :(

Postby Marc » Thu Nov 26, 2009 6:47 am

I see, woudl it be a solution if teh Funtion NewtonGetVerstion was update in each Beta to returns the Beta Version.

that would probably be fine too :)

I second that :)
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest

cron