Crashes when porting a newton 2.x program to 3.00

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Crashes when porting a newton 2.x program to 3.00

Postby carli2 » Sat Jul 07, 2012 10:47 am

Hi,

I translated the newton 3 header to pascal now and corrected all calls where the interface had changed.
But there are still problems:
The objects fall through the ground and through the landscape (the landscape is a compound collision of convex collisions).
After I add my player (which is a object that does lots of convex casts), I get the following crash:
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd704e700 (LWP 4235)]
0x00007ffff73a9be8 in dgCollisionCompound::CalculateContactsToSingle (this=0xef7b80,
    pair=<optimized out>, proxy=..., useSimd=<optimized out>)
    at ../../source/physics/dgCollisionCompound.cpp:1512
1512                     dgCollisionInstance* const childInstance = me->GetShape();
(gdb) backtrace
#0  0x00007ffff73a9be8 in dgCollisionCompound::CalculateContactsToSingle (this=0xef7b80,
    pair=<optimized out>, proxy=..., useSimd=<optimized out>)
    at ../../source/physics/dgCollisionCompound.cpp:1512
#1  0x00007ffff73acbf1 in dgCollisionCompound::CalculateContacts (this=0xef7b80,
    pair=0x7fffd7032f60, proxy=..., useSimd=0)
    at ../../source/physics/dgCollisionCompound.cpp:1324
#2  0x00007ffff742db8c in dgWorld::CompoundContacts (this=0xde07c0, pair=0x7fffd7032f60,
    proxy=...) at ../../source/physics/dgNarrowPhaseCollision.cpp:1023
#3  0x00007ffff742de98 in dgWorld::CalculateContacts (this=0xde07c0, pair=0x7fffd7032f60,
    timestep=<optimized out>, threadIndex=<optimized out>)
    at ../../source/physics/dgNarrowPhaseCollision.cpp:1410
#4  0x00007ffff742f787 in dgWorld::CollideContinue (this=0xde07c0, collisionSrcA=0x1523f00,
    matrixA=..., velocA=..., omegaA=..., collisionSrcB=<optimized out>, matrixB=...,
    velocB=..., omegaB=..., retTimeStep=@0x7fffd7033da0: 1e+10, points=0x7fffd70338e0,
    normals=0x7fffd7033a60, penetration=0x7fffd7033cb0, maxSize=32, threadIndex=0)
    at ../../source/physics/dgNarrowPhaseCollision.cpp:1617
#5  0x00007ffff738f8a0 in dgBroadPhaseCollision::ConvexCast (this=0xde07f0, shape=0x1523f00,
    matrix0=..., target=..., timeToImpact=@0x7fffd70340ec: 0,
    prefilter=0x5d1350 <MYPREFILTER>, userData=0x7fffd502b840, info=0x7fffd542d060,
    maxContacts=128, threadIndex=0) at ../../source/physics/dgBroadPhaseCollision.cpp:561
#6  0x00007ffff7478a1f in NewtonWorldConvexCast (newtonWorld=<optimized out>,
    matrix=<optimized out>, target=<optimized out>, shape=<optimized out>,
    hitParam=<optimized out>, userData=<optimized out>, prefilter=0x5d1350 <MYPREFILTER>,
    info=0x7fffd542d060, maxContactsCount=128, threadIndex=0)
    at ../../source/newton/Newton.cpp:1360
#7  0x00000000005d1668 in MOVETILL (HOME=0x7fffd70340fc, PARS=0x1523f00)
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 » Sat Jul 07, 2012 1:01 pm

do yo uhave a test demo for debugging?
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 » Sun Jul 08, 2012 1:07 pm

Julio Jerez wrote:do yo uhave a test demo for debugging?


Win32 or Linux64? (for win32, i need a dll, is "applications/newtonModelEditor/Win32/newton.dll" a valid newton3 dll?)
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 » Sun Jul 08, 2012 1:22 pm

win32
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 » Sun Jul 08, 2012 2:03 pm

Here's the working one using Newton 2.x: http://botwars.tk/winrelease.zip

And this is the broken one with ported newton 3. It should behave nearly equally: http://botwars.tk/winrelease2.zip

Just ignore the JSON parser errors and go to "New game -> Techtest" (Techtest is bottom right)
I use objects with mass 0 to give them a static position.
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 » Sun Jul 08, 2012 4:31 pm

somethong is wrong with yor program, when I ruun it Norton says the is a security risk gin wl.exe and shot it down and delete the program.
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 » Sun Jul 08, 2012 5:13 pm

Julio Jerez wrote:somethong is wrong with yor program, when I ruun it Norton says the is a security risk gin wl.exe and shot it down and delete the program.

The correct executables filename is gwx.exe, not wl.exe.
In winrelease2 (the newton3 version), it is gwx.exe. In winrelease (newton2) it is gwX.engine (which is basically a renamed .exe, and gwx.exe runs it. you can rename gwX.engine to engine.exe)
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 » Sun Jul 08, 2012 5:47 pm

yes that file Norton says that has securtity provblem.
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 » Mon Jul 09, 2012 1:04 pm

rename it to sth with .exe extension and it will work.
anti viruses are snake oil. when you want to be sure to not get infected by programs sent to you, use a windows live cd.

Edit: try the second zip which is the one using newton 3
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 » Mon Jul 09, 2012 2:00 pm

I will again try tonight.
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 Julio Jerez » Tue Jul 10, 2012 8:12 am

Ok I download again and rename it, but norton say that there si a dangerus risk on that file and remove it from the machine.
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 » Wed Jul 11, 2012 10:30 am

Did you really try this file? http://botwars.tk/winrelease2.zip

And what exactly did you change from newton 2.xx to 3.00 that all objects fall through each other? Did I forget to set a collide bit for the material combination 0-0?

Can you please come to freenode #newtondynamics? it's hard to solve this problem with the forum. (and your commit messages are pointless, i cannot read when exactly you fixed a bug or introduced some incompatibility)
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 » Wed Jul 11, 2012 11:03 am

yes I download thsi file http://botwars.tk/winrelease2.zip
and run with and with out renaming the .exe in both cases norton is very unhappy about and delete the exe


as to what I change form 2.00 to 300, well ther are lot of changes, bu teh main one are thet teh collsion system is now instance base as oppose to reference count base.
the collision system now is a lot more flexible and supports general scaling in all shapes.
the secund major change is that now the engine run on its own thread, this can make run conrurrent or sequencial with the main thread.
The thread system is also exposed so that the application can do stuff by hooking pre or post listeners.
there are many other changes but I do not remember now.
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 » Wed Jul 11, 2012 11:27 am

I get the following backtrace:

Code: Select all
0x00007ffff73a5658 in dgCollisionCompound::CalculateContactsToSingle (this=0xeee580, pair=<optimized out>, proxy=..., useSimd=<optimized out>)
    at ../../source/physics/dgCollisionCompound.cpp:1508
1508                     processContacts = constraint->GetMaterial()->m_compoundAABBOverlap (*constraint->GetMaterial(), *compoundBody, *otherBody, proxy.m_threadIndex);
(gdb) backtrace
#0  0x00007ffff73a5658 in dgCollisionCompound::CalculateContactsToSingle (this=0xeee580, pair=<optimized out>, proxy=..., useSimd=<optimized out>)
    at ../../source/physics/dgCollisionCompound.cpp:1508
#1  0x00007ffff73a8661 in dgCollisionCompound::CalculateContacts (this=0xeee580, pair=0x7fffd6dd2f60, proxy=..., useSimd=0)
    at ../../source/physics/dgCollisionCompound.cpp:1320
#2  0x00007ffff7429f0c in dgWorld::CompoundContacts (this=0xddf680, pair=0x7fffd6dd2f60, proxy=...)
    at ../../source/physics/dgNarrowPhaseCollision.cpp:1023
#3  0x00007ffff742a218 in dgWorld::CalculateContacts (this=0xddf680, pair=0x7fffd6dd2f60, timestep=<optimized out>, threadIndex=<optimized out>)
    at ../../source/physics/dgNarrowPhaseCollision.cpp:1410
#4  0x00007ffff742bb07 in dgWorld::CollideContinue (this=0xddf680, collisionSrcA=0xeb79c0, matrixA=..., velocA=..., omegaA=...,
    collisionSrcB=<optimized out>, matrixB=..., velocB=..., omegaB=..., retTimeStep=@0x7fffd6dd3da0: 1e+10, points=0x7fffd6dd38e0,
    normals=0x7fffd6dd3a60, penetration=0x7fffd6dd3cb0, maxSize=32, threadIndex=0) at ../../source/physics/dgNarrowPhaseCollision.cpp:1617
#5  0x00007ffff738ab30 in dgBroadPhaseCollision::ConvexCast (this=0xddf6b0, shape=0xeb79c0, matrix0=..., target=...,
    timeToImpact=@0x7fffd6dd40ec: 0, prefilter=0x5d15c8 <MYPREFILTER>, userData=0x7fffd5d59840, info=0x7fffe1d94060, maxContacts=128,
    threadIndex=0) at ../../source/physics/dgBroadPhaseCollision.cpp:561
#6  0x00007ffff7477d4f in NewtonWorldConvexCast (newtonWorld=<optimized out>, matrix=<optimized out>, target=<optimized out>,
    shape=<optimized out>, hitParam=<optimized out>, userData=<optimized out>, prefilter=0x5d15c8 <MYPREFILTER>, info=0x7fffe1d94060,
    maxContactsCount=128, threadIndex=0) at ../../source/newton/Newton.cpp:1360
#7  0x00000000005d18e0 in MOVETILL (HOME=0x7fffd6dd40fc, PARS=0xeb79c0) at physicscript.pas:620



For threadIndex, I always tell 0 to the engine. Is that wrong?
Also, can two callbacks be called at the same time?
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 3:37 am

Btw what exactly did you change in the contacts code?
Afaik the contacts are responsible for objects not falling through everything and a call to ConvexCast also crashes at some contacts code.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests

cron