Crashes when porting a newton 2.x program to 3.00

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Thu Jul 12, 2012 7:34 am

I do not remember is code has has evolve a lot form core 200, it is better in every way but I do not have a ldetail ist of the changes.

like I say before try these totorial that are all in the download
http://newtondynamics.com/wiki/index.ph ... gid_Bodies
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Thu Jul 12, 2012 12:25 pm

Maybe you can look over this patch in my game which basically introduces newton 3
http://goldenwipf.de/hg/index.cgi/rev/42d273945e12

Maybe you find what I have missed.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Thu Jul 12, 2012 12:52 pm

Julio Jerez wrote:I do not remember is code has has evolve a lot form core 200, it is better in every way but I do not have a ldetail ist of the changes.

like I say before try these totorial that are all in the download
http://newtondynamics.com/wiki/index.ph ... gid_Bodies

NewtonSetWorldSize (world, &minBox[0], &maxBox[0]); is a Newton 2.xx function. But Newton 2.xx is working for me.
I'm looking for Newton 3 Tutorial.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Thu Jul 12, 2012 2:33 pm

I said the tutorial are up to day in the svn archive.
Delfi who was helping me with the the forum and the wiki put the tutorial text when I wrote them,
but he has not being aroun in a long time and I forget how to log int.

In the SDK dowload for SVN, those differences are corrected and they work with SDK core 300.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 3:27 am

I looked at the tutorials in the SVN multiple times. But i don't see anything I'm missing though my code worked for newton 2.xx

Did you look at the patch? http://goldenwipf.de/hg/index.cgi/rev/42d273945e12

And did you change the matrix row/col order or anything like that?
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Fri Jul 13, 2012 6:40 am

It is difficult to see what is different in a patch. all I can see i sthat yuo can NewtonUpdate from with in a critical section, I do not think that is right.
no the matrix order has not changed.

also I do not know why you have so many probem moving to newton 300, they chnage requore no more thjan a n hour of two of editing and recompiling.
Not one else has has so many problems.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 7:24 am

Julio Jerez wrote:It is difficult to see what is different in a patch. all I can see i sthat yuo can NewtonUpdate from with in a critical section, I do not think that is right.
no the matrix order has not changed.

Removing the critical section code is not working, too.

Julio Jerez wrote:also I do not know why you have so many probem moving to newton 300, they chnage requore no more thjan a n hour of two of editing and recompiling.
Not one else has has so many problems.

Yes, that's exactly what I've done. But after that, I saw a world where most objects had some nasty matrices and some objects fell through the ground.

I removed the call to NewtonUpdate() and now I saw that some objects had strange matrices. I should see if the binary representation of matrices changed.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 8:55 am

I just logged all matrices of the objects and I observed the following:
- On creation, correct matrices were set
- After simulation, the matrices hat 0 in the 3x3 submatrix
- This explains why my objects are showing up that weird
- ConvexCast returns "no collision" even if there is the ground plate

Here's the log:
http://paste.ubuntu.com/1089780/

A line "create" means a object is created
A line "set new" means a setMatrix call
A line "MoveTill" means a setmatrix after the path was checked with convexCast
A line "Matrix" means the updated matrix of the object after a simulation step
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Fri Jul 13, 2012 10:03 am

can you buidl the library in debug mode? the engine has many assert that will show where and went the matrix when wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 1:22 pm

I built Newton with "-DNDEBUG -g", but no errors on stdout.
I assume it's sth with the data representation that changed. Matrices are dFloat *. I assume they are single float aligned to 4 and there are 16 floats behind such a pointer.
But the matrix corruption seems to happen in newton, not in the application.


btw the compilation showed the following:
Code: Select all
../../source/physics/dgNarrowPhaseCollision.cpp: In member function ‘void dgWorld::SceneContactsSimd(dgCollidingPairCollector::dgPair*, dgCollisionParamProxy&) const’:
../../source/physics/dgNarrowPhaseCollision.cpp:1315:101: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Fri Jul 13, 2012 2:33 pm

you need to open file ../coreLibrary_300\source\core\dgTypes.h
and define _ASSERTE to the proper Linux assert macro and compile the library

Code: Select all
#if !(defined (_WIN_32_VER) || defined (_WIN_64_VER))
   #ifdef _DEBUG
      #define _ASSERTE(x) assert(x)
   #else
// define the standrd OS assert here.
      #define _ASSERTE(x)
   #endif
#endif



and I repeat the matrices had not changed, all matrices in the low level library are 32 byte aligned in core 300 and 16 bytes aligned in core 200.
matrices has copy contructor to do teh proper aligmnet.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 3:31 pm

After some changes at the trace code and other things, I got the assertions working.
Here's the first assertion fail:
Code: Select all
gwX.engine: ../../source/core/dgThreadHive.h:122: void dgThreadHive::GetIndirectLock(dgInt32*, dgUnsigned32) const: Assertion `dgInt32 (sizeof (dgInt32)) == dgInt32 (sizeof (long))' failed.


Next assertion:
Code: Select all
gwX.engine: ../../source/physics/dgBody.cpp:495: virtual void dgBody::UpdateCollisionMatrix(dgFloat32, dgInt32): Assertion `0' failed.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Fri Jul 13, 2012 3:47 pm

Ha, I see you are in linux 64. This:
Code: Select all
gwX.engine: ../../source/core/dgThreadHive.h:122: void dgThreadHive::GetIndirectLock(dgInt32*, dgUnsigned32) const: Assertion `dgInt32 (sizeof (dgInt32)) == dgInt32 (sizeof (long))' failed.

Is a legacy from when I was not using ptread, but now I am. all the lock are using int not long.
In 64 bit linux long are 64 bit ints, in 64 VS long are 32 bit int, xcode has an option.
You can comment that line out for now, I fix it in next check in.
//_ASSERTE (dgInt32 (sizeof (dgInt32)) == dgInt32 (sizeof (long)));

The secund you has Continue collision enable, do no use for now until it is fully ready.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Fri Jul 13, 2012 3:57 pm

Yep. I commented out the assertions for the first case.
After deactivating continuous collision, i get the following:
Code: Select all
gwX.engine: ../../source/physics/dgBody.h:766: virtual void dgBody::SetMatrixOriginAndRotation(const dgMatrix&): Assertion `dgAbsf (val - 1.0f) < 1.0e-5f' failed.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Crashes when porting a newton 2.x program to 3.00

Postby Julio Jerez » Fri Jul 13, 2012 4:44 pm

where it is called from?
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 10 guests

cron