strong impulses when actuating joints

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: strong impulses when actuating joints

Postby Julio Jerez » Mon Oct 15, 2018 1:09 pm

ok I will try that tonight.
I briefly look at the code, and under not circumstance a body should result in not having a null broadphase mode, so I will add and asset to the phase that come before that.
second if the assert does not catches it, them it is a bigger problem.
tell me one thing when the crash happens, are you ruining singled threaded?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: strong impulses when actuating joints

Postby Sweenie » Mon Oct 15, 2018 1:34 pm

Was running on my work computer so cant check the settings until tomorrow but it was definitely running with the default multithreaded mode of Newton, but if it was running in concurrent(async) mode in unity i cant check until tomorrow.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: strong impulses when actuating joints

Postby Julio Jerez » Mon Oct 15, 2018 1:43 pm

if you get any time, let us see if it happen single threaded and synchronous.
I suspect that some how running asyncrounus, a call to delete a body is made, and that will invalidate the body array.
this could be cause by the recent optimization the May overclock some lock.

blackbeard, is there some logic that remove a body at rum time? can you try with setting run synchronous and single threaded and the various permutations of those options.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: strong impulses when actuating joints

Postby blackbird_dream » Tue Oct 16, 2018 1:39 am

No. Not at runtime. I just meant if you remove the free NBody from the model then the model works. No crash.
Asynchronous Update unselected + Single threaded => crash
Asynchronous Update selected + Single threaded => crash
Asynchronous Update unselected + 2 worker threads => crash
Asynchronous Update unselected + Single threaded + Broad phase type mixed => crash
Asynchronous Update unselected + Single threaded + Solver iterations count=3 => crash
Last edited by blackbird_dream on Tue Oct 16, 2018 2:42 am, edited 3 times in total.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: strong impulses when actuating joints

Postby Sweenie » Tue Oct 16, 2018 2:37 am

In Unity the world is updated synchronously and worker threads is set to "Single threaded" and broadphase type "Segregated".
I've tried async, several threads and mixed broadphase but it makes no difference.

Finally I even recompiled the Newton libs with DG_USE_THREAD_EMULATION but it still crashes with broadPhaseNode being NULL.

Here is the serialized scene by the way ---> http://www.svenberra.net/flt.bin
Tried to test it in the sandbox but can't load serialized scenes for some reason. Nothing happens when I chose Open or Deserialize from the menu.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: strong impulses when actuating joints

Postby Sweenie » Tue Oct 16, 2018 3:04 am

Aha.

Got another clue.
As blackbird mentioned there is a single body besides the box with the actuators.
That body has no collider. If I add a boxcollider to it I don't get a crash anymore.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: strong impulses when actuating joints

Postby blackbird_dream » Tue Oct 16, 2018 3:30 am

also if you click 'Calculate Inertia' to the body named chassis it takes longer time before crashing.
It seems the crash occurs when the velocity is null.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: strong impulses when actuating joints

Postby Julio Jerez » Tue Oct 16, 2018 6:27 am

there a box without collided? how can that be be? to create a newton body a collided is required in the argument list.

any way we now know is not a threading thing, I will check it out.
it seems there are some catastrofic loose end in the plugin.
an inertia with a diagonal value of zero should issue some warning on the unity size, and so should a dynamic body with not collider.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: strong impulses when actuating joints

Postby Sweenie » Tue Oct 16, 2018 6:46 am

The plugin falls back to the NullCollision if no collision shape is added to the body.

Code: Select all
        else if (colliderList.Count == 0)
        {
            m_collidersArray = new ColliderShapePair[1];
            NewtonCollider collider = body.gameObject.AddComponent<NewtonNullCollider>();
            m_collidersArray[0].m_collider = collider;
            m_collidersArray[0].m_shape = collider.Create(body.m_world);
        }
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: strong impulses when actuating joints

Postby blackbird_dream » Tue Oct 16, 2018 7:30 am

yes It adds a so called nullcollider at runtime indeed as much as I remember. Is it correct?
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: strong impulses when actuating joints

Postby Julio Jerez » Tue Oct 16, 2018 7:44 am

that should be correct, but the new optimization may not account for that.
I will verify that is the case.

does it run if the body is a signed some other non null shape?

and now that I can think off that's a good explanation for the cause of the crash.

a body with null shape will be in the body list, but will not have a broadphase node.
if you look at the trace stack, the loop is iterating over the body list not over the list of bodies in the broadphase.
this is why it crashes when some object reach zero velocity, the optimization interates over the body list because as bodies go to rest if there are more body at rest than moving, then it is faster to do only the active bodies in a sweep forward and backward than a full forward sweep and prune over all bodies

this is a good justification for adding a check that the body must has broadphase node, and that will be legitimate.

I think I have fix now. it will try add-on a couple of null collisions, and that should reproduce it, and I get it fixed.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: strong impulses when actuating joints

Postby Sweenie » Tue Oct 16, 2018 7:45 am

I guess this is a very special case bug.

Doing any of the following changes prevent the crash from happening.

A) Add a box or sphere collider to the single body(named 'Volant') in the example scene.
B) Remove the body name 'Volant'
C) Remove one of the slideractuators from the body called 'chassi'
D) Add another single body with a NullCollider, that is, just duplicate the gameobject 'Volant'.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: strong impulses when actuating joints

Postby blackbird_dream » Tue Oct 16, 2018 8:04 am

you don't have the very bascic test. The most minimal test doesn't include volant. I removed one body in the linked hierarchy.
there is only chassi, mat_mobile and tablier
and beside the free body named GameObject.
here:
https://we.tl/t-HmcVJo1eVe
but it's very similar
Last edited by blackbird_dream on Tue Oct 16, 2018 8:07 am, edited 1 time in total.
User avatar
blackbird_dream
 
Posts: 354
Joined: Wed Jun 07, 2006 3:08 pm
Location: France

Re: strong impulses when actuating joints

Postby Julio Jerez » Tue Oct 16, 2018 8:06 am

oh, I see this may also explain the random crashes other people had reported, if a body is automatically asigned a null shape, it will eventually crash if and only if half the bodies in the scene go to sleep.
that will look like a random crash, but is in fact deterministic.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: strong impulses when actuating joints

Postby Julio Jerez » Tue Oct 16, 2018 8:09 am

let me get that bug fixed and we try again, this is a legitimate bug that explain lots of these crashes.
they may be others, but let get this one first.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 8 guests