Crash Unity

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Crash Unity

Postby pysnoo » Fri Nov 09, 2018 11:16 am

Ok, thanks.

(btw, I have an error when a joint is destroyed. Apparently, it comes from NewtonJoint.OnDestroy where m_joint is null, I added a check - NewtonUnityPlugin).
pysnoo
 
Posts: 24
Joined: Mon Oct 08, 2018 9:08 am

Re: Crash Unity

Postby pysnoo » Mon Nov 12, 2018 5:07 am

Hey back,

Still have assertion :
Code: Select all
dgAbs(relCentr) < dgFloat32 (1.0e-3f)


With the following call stack :
Code: Select all
========== OUTPUTING STACK TRACE ==================

0x00007FFD610E74A2 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgbilateralconstraint.cpp:317] dgBilateralConstraint::CalculateAngularDerivative
0x00007FFD61003AEB (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgnewton\newtonclass.cpp:130] NewtonUserJoint::AddAngularRowJacobian
0x00007FFD60FFB95F (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgnewton\newton.cpp:7239] NewtonUserJointAddAngularRow
0x00007FFD6116380D (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dcustomjoints\dcustomhinge.cpp:263] dCustomHinge::SubmitAngularRow
0x00007FFD611631EB (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dcustomjoints\dcustomhinge.cpp:299] dCustomHinge::SubmitConstraints
0x00007FFD6115E486 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dcustomjoints\dcustomjoint.cpp:225] dCustomJoint::SubmitConstraints
0x00007FFD61003948 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgnewton\newtonclass.cpp:102] NewtonUserJoint::JacobianDerivative
0x00007FFD6102EA57 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworlddynamicupdate.cpp:590] dgWorldDynamicUpdate::GetJacobianDerivatives
0x00007FFD61031E89 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworlddynamicupdate.cpp:842] dgWorldDynamicUpdate::BuildJacobianMatrix
0x00007FFD610DDB40 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworlddynamicssimplesolver.cpp:49] dgWorldDynamicUpdate::ResolveClusterForces
0x00007FFD610311EC (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworlddynamicupdate.cpp:565] dgWorldDynamicUpdate::CalculateClusterReactionForcesKernel
0x00007FFD612D2D2B (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgcore\dgthreadhive.cpp:157] dgThreadHive::QueueJob
0x00007FFD6102E47E (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworlddynamicupdate.cpp:141] dgWorldDynamicUpdate::UpdateDynamics
0x00007FFD610497A5 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworld.cpp:907] dgWorld::StepDynamics
0x00007FFD6104E75C (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworld.cpp:982] dgWorld::RunStep
0x00007FFD6104FCC1 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgphysics\dgworld.cpp:1014] dgWorld::TickCallback
0x00007FFD612DAA56 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgcore\dgmutexthread.cpp:60] dgMutexThread::Execute
0x00007FFD612D97D6 (NewtonWrapper) [c:\cha_dynamics\newton-dynamics\sdk\dgcore\dgthread.cpp:171] dgThread::dgThreadSystemCallback
0x00007FFD612DA555 (NewtonWrapper) [c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\thr\xthread:245] std::_LaunchPad<std::unique_ptr<std::tuple<void * (__cdecl*)(void *),dgThread *>,std::default_delete<std::tuple<void * (__cdecl*)(void *),dgThread *> > > >::_Run
0x00007FFD612DA1DD (NewtonWrapper) [c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\thr\xthread:231] std::_LaunchPad<std::unique_ptr<std::tuple<void * (__cdecl*)(void *),dgThread *>,std::default_delete<std::tuple<void * (__cdecl*)(void *),dgThread *> > > >::_Go
0x00007FFD612DA189 (NewtonWrapper) [c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\thr\xthread:209] std::_Pad::_Call_func
0x00007FFD61260988 (NewtonWrapper) [minkernel\crts\ucrt\src\appcrt\startup\thread.cpp:92] invoke_thread_procedure
0x00007FFD61260531 (NewtonWrapper) [minkernel\crts\ucrt\src\appcrt\startup\thread.cpp:115] thread_start<unsigned int (__cdecl*)(void * __ptr64)>
0x00007FFDCBAE3034 (KERNEL32) BaseThreadInitThunk
0x00007FFDCBD51431 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========


Again the vehicle was shaking before it explodes : project link (with latest dlls)

@Sweenie, can you add a check if null in your NewtonJoint destruction and a getter to access to bodies list in NewtonWorld ?
pysnoo
 
Posts: 24
Joined: Mon Oct 08, 2018 9:08 am

Re: Crash Unity

Postby Sweenie » Mon Nov 12, 2018 3:05 pm

I'm down with the flu right now so will have to check this later. I don't really understand how m_joint could be null though. The joint component should hold a reference to it preventing it from being GC:ed.
There was a bug before there the native joint would be destroyed twice in some cases but that was fixed a while back.

Does it happen randomly or can you make it happen all the time?
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Crash Unity

Postby pysnoo » Tue Nov 13, 2018 3:43 am

I git pulled your fix without revert the file, actually it works fine.
Yes, the crash happens all the time when the vehicle collides with something.

Take care of you and keep in touch :wink:
pysnoo
 
Posts: 24
Joined: Mon Oct 08, 2018 9:08 am

Re: Crash Unity

Postby Julio Jerez » Wed Nov 14, 2018 8:48 am

I do not know what it is about this project that I can't open it not matter what I do but other people can without problems. I get a blank screen and several hundred errors like these
Assets/Scripts/truck.cs(4,7): error CS0246: The type or namespace name `FLTTire' could not be found. Are you missing an assembly reference?
Assets/Scripts/dir_d.cs(5,22): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/dir_g.cs(5,22): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/fd.cs(5,19): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/fg.cs(5,19): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/lift.cs(5,21): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/steer.cs(5,22): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/tab.cs(5,20): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/tilt.cs(5,21): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/transl.cs(5,23): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/truck.cs(6,22): error CS0246: The type or namespace name `NewtonBodyScript' could not be found. Are you missing an assembly reference?
Assets/Scripts/dir_d.cs(7,5): error CS0246: The type or namespace name `NewtonHingeActuator' could not be found. Are you missing an assembly reference?
Assets/Scripts/dir_d.cs(9,5): error CS0246: The type or namespace name `NewtonHingeActuator' could not be found. Are you missing an assembly reference?
...
...


could it be because I have an older unity version, I get the message when I start. but hwo do I fix that?
Untitled.png
Untitled.png (23.26 KiB) Viewed 5456 times
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash Unity

Postby pysnoo » Wed Nov 14, 2018 9:03 am

You have to check if each dll has platform selected like this (in older version)
http://tinyurl.com/ybny896y.

Actually, you don't need System.Management and UnityEngine dlls (in plugins), you can delete them.
pysnoo
 
Posts: 24
Joined: Mon Oct 08, 2018 9:08 am

Re: Crash Unity

Postby Julio Jerez » Thu Nov 15, 2018 10:28 am

Sweenie, I was try to get pf the demos and when I click you vehicle demo, I get these error.
(Filename: C:/Development/NewtonUnityPlugin/NewtonPlugin/NewtonBodyVehicle.cs Line: 37)

destroy actual wheel
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
NewtonBodyWheel:DestroyTire() (at C:\Development\NewtonUnityPlugin\NewtonPlugin\NewtonBodyWheel.cs:70)
NewtonBodyVehicle:OnDestroy() (at C:\Development\NewtonUnityPlugin\NewtonPlugin\NewtonBodyVehicle.cs:43)

(Filename: C:/Development/NewtonUnityPlugin/NewtonPlugin/NewtonBodyWheel.cs Line: 70)

NullReferenceException: Object reference not set to an instance of an object
at NewtonBodyWheel.DestroyTire () [0x0000c] in C:\Development\NewtonUnityPlugin\NewtonPlugin\NewtonBodyWheel.cs:74
at NewtonBodyVehicle.OnDestroy () [0x0003a] in C:\Development\NewtonUnityPlugin\NewtonPlugin\NewtonBodyVehicle.cs:43

(Filename: C:/Development/NewtonUnityPlugin/NewtonPlugin/NewtonBodyWheel.cs Line: 74)


it seems to be on this function that try to destroy an object,
Code: Select all
  public void DestroyTire()
    {
        Debug.Log("destroy actual wheel");
        //var handle = GCHandle.FromIntPtr(m_wheel.GetUserData());
        //handle.Free();

        m_wheel.Dispose();
        m_wheel = null;
    }


but for light of me I do not know how to test this. I can not set break points on any .cs function
or anywhere else.
I think unit somehow * up stuff that prevent people from steeping in code and instead they produce those moronic logs that do nothing to me as if that was going to be better that the compiler debugger.
I have seen other csharp projects that I can set break point and can be debugger but I never been abled to debug a unity script or class. this happens only in Unity.

anyway I wanted to make a box on for wheels with a fork so that that we can communicate with blackbird dream better.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crash Unity

Postby Sweenie » Thu Nov 15, 2018 1:10 pm

Yeah, it's a bit of work to get debugging working with Unity.
First of all Unity is using Mono to execute the C# code so the symbol files(pdb) generated by Visual Studio are worthless on their own. They have to be converted to mdb files which mono uses.
I recently added a batch file in the pluginbin folder that should generate these mdb files. Run the batch file after compiling the plugin. I haven't automated this so the mdb files will have to be copied over to the plugins folder in the project.
Then you have to attach the visual studio debugger to Unity Editor process. If you opened visual studio through the editor there should be a button for this. This should trigger the c# breakpoints.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 9 guests

cron