[SOLVED] Crash on destroying bodies

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 8:38 am

I tried to run it again and again I get a bunch of assert sayin that newton checksum has changed.
I click continue and after few dozen of those, the game start

I do not get any assert on the newton.dll in debug but them moment I start to move the player either die, or seem to fall trough a hole and is game over after that.
you have some kind pf protection that make is hard to debug.

but You said that you got a crash here newton.dll!dgBroadPhase::SanityCheck()

I think this explain what is going on, and I thin is this.

when a body is deleted,
the body set it call back to NULL, and detach all his link.
if flag all is contact joint as killed
is placed of a dead list for remove at the end o fthe update.

whoever is possible that the make a new contact, tha will not be tagged as dead.
them what happen is that the body will be deleted and that way ther will be a contact that link at least one dead body.
this is one logical error that does nee to be fix.

edit: yes thsi is the bug, I added a test to check for that in the buoyancy demo and is happen right away.
I am fixing it now.

I will do that and let of try again
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 9:34 am

ok I believe I have it fixed for real now.
I build the new dll and copied to your demo and I did not get the list of error I was getting before.
It went to point where ask me to enter stuff to start playing.

can you please sync and try, maybe we can move to the next bug if is still there.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Tue Nov 26, 2019 12:15 pm

Julio Jerez wrote:I tried to run it again and again I get a bunch of assert sayin that newton checksum has changed.
I click continue and after few dozen of those, the game start


The game detects if newton.dll changes and rebuilds serialized collisions for map, it does this so that it makes sure it is not trying to deserialize files when they could be incompatible with newton version :)

Julio Jerez wrote:I tried to run it again and again I get a bunch of assert sayin that newton
I do not get any assert on the newton.dll in debug but them moment I start to move the player either die, or seem to fall trough a hole and is game over after that.
you have some kind pf protection that make is hard to debug.

but You said that you got a crash here newton.dll!dgBroadPhase::SanityCheck()


Debug and release newton builds crashed at different addresses:

The game in demo should crash immediately, i usually didn't even need to move - there is no protection - can i do any change to make it more easy to gebug?

Release crashed in dgBroadPhase::UpdateRigidBodyContacts.

Debug crashed in dgBroadPhase::SanityCheck (different function).

Julio Jerez wrote:
I think this explain what is going on, and I thin is this.

when a body is deleted,
the body set it call back to NULL, and detach all his link.
if flag all is contact joint as killed
is placed of a dead list for remove at the end o fthe update.

whoever is possible that the make a new contact, tha will not be tagged as dead.
them what happen is that the body will be deleted and that way ther will be a contact that link at least one dead body.
this is one logical error that does nee to be fix.

edit: yes thsi is the bug, I added a test to check for that in the buoyancy demo and is happen right away.
I am fixing it now.

I will do that and let of try again


Ok, i tested and compiled newton and it now triggers the correct assert

Program: J:\AppBuilder\Delfi\Top Down City\Game\Libraries\Newton.dll
File: ..\..\dgPhysics\dgContact.cpp
Line: 90

Expression: !body0->m_isdead

I assume you are working on the fix now :) Thanks, i will test it immediately, just let me know when iit's ready.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 12:41 pm

I committed the fix this morning,
Please check again and if you get the assert in contact line 90
Show me the stack trace .

That is what cause the crash, but this should not be happening anymore.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Tue Nov 26, 2019 1:47 pm

Julio Jerez wrote:I committed the fix this morning,
Please check again and if you get the assert in contact line 90
Show me the stack trace .

That is what cause the crash, but this should not be happening anymore.


Ok. here is the stack trace to assert on line 90, it happens very quickly for me:

> newton.dll!_CrtDbgBreak() Line 87 C
newton.dll!_VCrtDbgReportW(nRptType=2, returnAddress=0x5e3a43c2, szFile=0x5e5ba90c, nLine=90, szModule=0x00000000, szFormat=0x5e5ba904, arglist=0x2322f7c8) Line 506 C
newton.dll!_CrtDbgReportWV(nRptType=2, returnAddress=0x5e3a43c2, szFile=0x5e5ba90c, nLine=90, szModule=0x00000000, szFormat=0x5e5ba904, arglist=0x2322f7c8) Line 262 C++
newton.dll!_CrtDbgReportW(nRptType=2, szFile=0x5e5ba90c, nLine=90, szModule=0x00000000, szFormat=0x5e5ba904, ...) Line 279 C++
newton.dll!dgContact::dgContact(world=0x190a26e0, material=0x191297c0, body0=0x2574fb20, body1=0x2574f880) Line 90 C++
newton.dll!dgBroadPhase::AddPair(body0=0x2574fb20, body1=0x2574f880, timestep=0.0166666675, threadID=1) Line 1237 C++
newton.dll!dgBroadPhase::SubmitPairs(leafNode=0x2554be00, node=0x2554ca00, timestep=0.0166666675, threadCount=4, threadID=1) Line 1326 C++
newton.dll!dgBroadPhaseMixed::FindCollidingPairs(descriptor=0x17e7fd84, nodePtr=0x19183ee0, threadID=1) Line 395 C++
newton.dll!dgBroadPhase::CollidingPairsKernel(context=0x17e7fd84, node=0x19183ee0, threadID=1) Line 1464 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=0x1913e49c) 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=0x022ee774) 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=0x022ee774) Line 28 C++
newton.dll!_callthreadstartex() Line 376 C
newton.dll!_threadstartex(ptd=0x1914aa40) Line 359 C
kernel32.dll!@BaseThreadInitThunk@12() Unknown
ntdll.dll!__RtlUserThreadStart() Unknown
ntdll.dll!__RtlUserThreadStart@8() Unknown

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

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 2:50 pm

ah very good, it is still the same bug buy the fix was incorrect.
it was too early in the code and there are other path to get to that contact constructor.

I believe it is correct now.
please try again.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Tue Nov 26, 2019 3:34 pm

This has fixed the crash :) so far it looks good.

However the problem you saw - falling thru ground still happens at random times, but if i see the debug meshes there are no more holes in the map, so it looks like sometimes the collision detection faults?

You can see this in the demo, just use a new newton.dll and walk around a bit, it will fall thru ground quickly.

It seems to happen if you touch vehicles - or generally in proximity of aabb of object and also standing on map piece?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Tue Nov 26, 2019 4:06 pm

Here is a new demo:

https://gtamp.com/tdc/tdc_demo_error.7z

Here is how it looks like, i also show where you can turn on newton debug rendering:

https://www.youtube.com/watch?v=mEP1-uP3nwE

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

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 4:29 pm

JernejL wrote:
However the problem you saw - falling thru ground still happens at random times, but if i see the debug meshes there are no more holes in the map, so it looks like sometimes the collision detection faults?

It seems to happen if you touch vehicles - or generally in proximity of aabb of object and also standing on map piece?


does that mean the background collision do not have hole, but the player is blowing up when it hit some other objects? if this is the case tell me how are you making your player.

this may have to do with the solver optimization I made few weeks ago.
the player might have been wrong all alone and was working because of was penalty fallback.
is the link the late with the later dll?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Tue Nov 26, 2019 5:03 pm

Julio Jerez wrote:
JernejL wrote:
However the problem you saw - falling thru ground still happens at random times, but if i see the debug meshes there are no more holes in the map, so it looks like sometimes the collision detection faults?

It seems to happen if you touch vehicles - or generally in proximity of aabb of object and also standing on map piece?


does that mean the background collision do no have hole, by the player is blowing up when it hit some other objects?
if this is the case tell me how are you making your player.

this may have to do with the solver optimization I made few weeks ago,
the player might have been wrong all alone, and was working because if was wrong on the penalty realm.
is the link the late with the later dll?


Yes, the link was updated with later dll (with the crash fixed).

Player is a convex hull with a custom written upvector joint.

It falls thru ground when touching or in proximity of multiple objects, if it is in touch with ground only, it seems ok.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Tue Nov 26, 2019 6:15 pm

ok I will check it out tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Wed Nov 27, 2019 3:39 am

Ok, excellent :) looking forward to fixing this, i'm happy to be helpful in testing
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: [SOLVED] Crash on destroying bodies

Postby JernejL » Wed Nov 27, 2019 10:55 am

I had another, additional assert crash happen, maybe this is related to bodies falling thru ground:

Code: Select all

Program: J:\AppBuilder\Delfi\Top Down City\Game\Libraries\Newton.dll
File: j:\appbuilder\delfi\top down city\code\tparty\newtonproject\newton-dynamics\sdk\dgcore\dgIntersections.h
Line: 137

Expression: m_diff.DotProduct(m_diff).GetScalar() > dgFloat32 (0.0f)

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

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Wed Nov 27, 2019 11:13 am

ok I download the last demo and I can now launch from visual studio.
when I walk to the nearest tractor, afte one or tow collsion the player disappeared.

and I see these messages

    Starting engine renderer loop
    [Frame:20] A body 0x1BC55840 left world location: 119.855, -78.773, -0.117 class: Car 19 collision kind: 6
    [Frame:20] A body 0x1BC55AE0 left world location: 119.802, -82.216, -0.125 class: Car 20 collision kind: 6
    [Newton] Body outside world destroyed: 1BC55840 - location 119.80239, -78.77266, -0.11719
    [Frame:74] A body 0x1C32BF80 left world location: 111.060, -74.270, -0.028 class: Actor 63 collision kind: 6
    [Frame:79] A body 0x1BC56AA0 left world location: 109.948, -75.007, -0.022 class: Actor 77 collision kind: 6
    [Newton] Body outside world destroyed: 1C32BF80 - location 109.94751, -74.26967, -0.02785
    [Newton] Body outside world destroyed: 1BC55AE0 - location 109.94751, -78.77266, -0.11719
    [Frame:167] A body 0x1C32D1E0 left world location: 109.256, -90.699, -0.022 class: Actor 70 collision kind: 6
    [Frame:178] A body 0x1C32C220 left world location: 109.662, -90.049, -0.022 class: Actor 64 collision kind: 6
    [Frame:296] A body 0x1C173680 left world location: 111.340, -80.880, -0.027 class: Actor 0 collision kind: 6
    [Newton] Body outside world destroyed: 1BC56AA0 - location 109.25636, -90.69923, -0.02198
    >> Program is unloading.

are you doing some kind of logic that that player are in more than one world or some stuff like that.

I do not see any velocity explosions, but I need to add some traces to track
what the player is doing and see why is blown up.

I have to leave for work now. but this is a long weekend, I will debug it tomorrow.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Crash on destroying bodies

Postby Julio Jerez » Wed Nov 27, 2019 11:19 am

JernejL wrote:I had another, additional assert crash happen, maybe this is related to bodies falling thru ground:

Code: Select all

Program: J:\AppBuilder\Delfi\Top Down City\Game\Libraries\Newton.dll
File: j:\appbuilder\delfi\top down city\code\tparty\newtonproject\newton-dynamics\sdk\dgcore\dgIntersections.h
Line: 137

Expression: m_diff.DotProduct(m_diff).GetScalar() > dgFloat32 (0.0f)



that a bad bug and may be the cause if the bug
function dgFastRayTest is use in many places, for ray, for calculation distances, for box overlap and so on, the funtion will fail for a zero length, but that should not happens.

it is reproducible?
if is happens again can you list the trace stack, to see when is come from. I may be able to fix is by inspection.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 5 guests

cron