Crash in dgContactSolver.cpp L: 643

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Sun Feb 09, 2020 4:35 pm

Before I download it can you make a simple one if you can.
Debugging complex scenes is much harder than simple one, and if the bug is the same.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in dgContactSolver.cpp L: 643

Postby Bird » Sun Feb 09, 2020 4:44 pm

Okay, I'll try to make a simpler version. There usually needs to be a pretty big pile of bodies before a crash will occur though.
Bird
 
Posts: 448
Joined: Tue Nov 22, 2011 1:27 am

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Sun Feb 09, 2020 5:07 pm

try what you can, the complexity is non linear a scene with double the number of bodies is about
4 to 10 time hard to debug, because the number of connection they generate.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in dgContactSolver.cpp L: 643

Postby Bird » Sun Feb 09, 2020 5:14 pm

Okay, this is about as simple as I can get and still crash. There's 1600 instances of a single body.

Stability is more important than speed in my apps, so fixing CC isn't so important to me if you have other things to do.
Attachments
newtonCrash_CC_ON.zip
(20.68 KiB) Downloaded 5 times
Bird
 
Posts: 448
Joined: Tue Nov 22, 2011 1:27 am

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Sun Feb 09, 2020 7:27 pm

ok thank for the repro.
I did not get the crash on the small one, so I try the large one and I did get a crash.
I will debug that one and see what is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Sun Feb 09, 2020 7:40 pm

ok I see the bug right away.
It is eassy to fix.
after I fix it, you need to sync again the version you are testing has some debug code.

but getting the new version is onle for completeness, in your case using CCD is onel justify if you are doing very small bodies.
you are better by doing more sub steps because I think you what better simulation.
CCD is more for realtime games that deal with reasonable small island and fast moving objects

this is different than few years ago when we did no have a paraller solver and ther was no real difference between CCD and discrete simulation, now with the parallel solve, the over hear of calculating time of impact for huge island is not that attractive.

anyway I see if I can get this fix because is a bad bug.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Sun Feb 09, 2020 10:38 pm

I believe I have the CCD fixed.
I am glad you sent me this demo that I can use as stress test.
I found some inefficiencies that I want to fix later.

for you, definitely should run without CCD is about 5 time faster, because CCD in effect render the paraller solver inactive, this is because the moment a body is declare CCD the entire island is CCD, and CCD island are solved by the sequential solver.

I run the big scene and by the end I have a crash because it run out or memory. one a buffer is 600+ megabyte, the vector try to resize the buffer and this is 1.2 gbytes which the other memory already allocated make windows run out of memory in 32 bit.

I assume you run in 64 bit.
in any case I will let is run in debug until it crash just to verify this is in fact the problem, them I will committee the fixes.

one think I notice is that I need to work on the collision. Believe or not with this scenes the solvers is faster than the collision, I'd never seem that case before.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash in dgContactSolver.cpp L: 643

Postby Julio Jerez » Mon Feb 10, 2020 10:46 am

Ok I confirmed the last crash was an out of memory in win32.

I run the same scene in 64 bit, and works beautifully.

You can get latter now.

This demo has exposed some functions of the collision system that can be improve substantially.
So I am grateful for that.

Anyway, the previous suggestion of replacing ccd with sub steps still stand.
Substep uses the parallel solver, and I'm general provide better simulation as the dt is always uniform.
Julio Jerez
Moderator
Moderator
 
Posts: 11124
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests