[Odejava] joint.delete()

Hi,
Is joint.delete() working for anybody? I can’t seem to get it to work…

I add the joint to a JointGroup, and when i want to delete that joint, it just doesn’t do it. No errors, no crashes, its as if that method is empty.

I have looked at the odejava code, and i traced it back to OdeJNI.dJointDestroy(long); and as you probably know, thats a native problem.

I tried to go to CVS and find out the problem in the natives, but it seems that the sources isn’t there, instead a note regarding that you obtain the ode.dll from the ODE CVS now instead…

I am using the latest Odejava release.

Thanks, DP

If a Joint is part of a JointGroup, then you must destroy it using JointGroup.delete(). Otherwise, Joint.delete works.

right ok…then there seems to be some problem with odejava.

The first couple of frames are ok and the physics works fine (if not part of a jointGroup), then i get a native crash in odejava.dll


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0xBCAE6F1
Function=[Unknown.]
Library=C:\eclipse\workspace\Physics\lib\odejava.dll

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
      at org.odejava.collision.JavaCollision.spaceCollide(Native Method)
      at org.odejava.collision.JavaCollision.collide(JavaCollision.java:150)
      at com.jmex.physics.PhysicsWorld.update(PhysicsWorld.java:578)
      at jmextest.physics.joints.TestHingeJoint2.simpleUpdate(TestHingeJoint2.java:71)
      at com.jme.app.SimpleGame.update(Unknown Source)
      at com.jme.app.BaseGame.start(Unknown Source)
      at jmextest.physics.joints.TestHingeJoint2.main(TestHingeJoint2.java:330)

Dynamic libraries:
0x00400000 - 0x00407000       C:\j2sdk1.4.2_04\bin\javaw.exe
0x7C900000 - 0x7C9B0000       C:\WINDOWS\system32\ntdll.dll
0x7C800000 - 0x7C8F4000       C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E6B000       C:\WINDOWS\system32\ADVAPI32.dll
0x77E70000 - 0x77F01000       C:\WINDOWS\system32\RPCRT4.dll
0x77D40000 - 0x77DD0000       C:\WINDOWS\system32\USER32.dll
0x77F10000 - 0x77F56000       C:\WINDOWS\system32\GDI32.dll
0x77C10000 - 0x77C68000       C:\WINDOWS\system32\MSVCRT.dll
0x629C0000 - 0x629C9000       C:\WINDOWS\system32\LPK.DLL
0x74D90000 - 0x74DFB000       C:\WINDOWS\system32\USP10.dll
0x08000000 - 0x08138000       C:\j2sdk1.4.2_04\jre\bin\client\jvm.dll
0x76B40000 - 0x76B6D000       C:\WINDOWS\system32\WINMM.dll
0x5CD70000 - 0x5CD77000       C:\WINDOWS\system32\serwvdrv.dll
0x5B0A0000 - 0x5B0A7000       C:\WINDOWS\system32\umdmxfrm.dll
0x10000000 - 0x10007000       C:\j2sdk1.4.2_04\jre\bin\hpi.dll
0x00940000 - 0x0094E000       C:\j2sdk1.4.2_04\jre\bin\verify.dll
0x00950000 - 0x00969000       C:\j2sdk1.4.2_04\jre\bin\java.dll
0x00970000 - 0x0097D000       C:\j2sdk1.4.2_04\jre\bin\zip.dll
0x00A40000 - 0x00A4F000       C:\j2sdk1.4.2_04\jre\bin\net.dll
0x71AB0000 - 0x71AC7000       C:\WINDOWS\system32\WS2_32.dll
0x71AA0000 - 0x71AA8000       C:\WINDOWS\system32\WS2HELP.dll
0x04EF0000 - 0x04EF8000       C:\j2sdk1.4.2_04\jre\bin\nio.dll
0x04F00000 - 0x0500F000       C:\j2sdk1.4.2_04\jre\bin\awt.dll
0x73000000 - 0x73026000       C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763AD000       C:\WINDOWS\system32\IMM32.dll
0x774E0000 - 0x7761D000       C:\WINDOWS\system32\ole32.dll
0x5AD70000 - 0x5ADA8000       C:\WINDOWS\system32\uxtheme.dll
0x05070000 - 0x050C0000       C:\j2sdk1.4.2_04\jre\bin\fontmanager.dll
0x73760000 - 0x737A9000       C:\WINDOWS\system32\ddraw.dll
0x73BC0000 - 0x73BC6000       C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73A10000       C:\WINDOWS\system32\D3DIM700.DLL
0x07CD0000 - 0x07D25000       C:\eclipse\workspace\Physics\lib\lwjgl.dll
0x72280000 - 0x722AA000       C:\WINDOWS\system32\DINPUT.dll
0x5ED00000 - 0x5EDCC000       C:\WINDOWS\system32\OPENGL32.dll
0x68B20000 - 0x68B40000       C:\WINDOWS\system32\GLU32.dll
0x77C00000 - 0x77C08000       C:\WINDOWS\system32\VERSION.dll
0x08140000 - 0x0853F000       C:\WINDOWS\Resources\themes\Luna\Luna.msstyles
0x69000000 - 0x6966E000       C:\WINDOWS\system32\atioglxx.dll
0x688F0000 - 0x688F9000       C:\WINDOWS\system32\HID.DLL
0x77920000 - 0x77A13000       C:\WINDOWS\system32\SETUPAPI.DLL
0x76C30000 - 0x76C5E000       C:\WINDOWS\system32\WINTRUST.dll
0x77A80000 - 0x77B14000       C:\WINDOWS\system32\CRYPT32.dll
0x77B20000 - 0x77B32000       C:\WINDOWS\system32\MSASN1.dll
0x76C90000 - 0x76CB8000       C:\WINDOWS\system32\IMAGEHLP.dll
0x0BC40000 - 0x0BCC9000       C:\eclipse\workspace\Physics\lib\odejava.dll
0x07FD0000 - 0x07FEE000       C:\j2sdk1.4.2_04\jre\bin\jpeg.dll
0x0C9E0000 - 0x0CA03000       C:\j2sdk1.4.2_04\jre\bin\cmm.dll
0x59A60000 - 0x59B01000       C:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000       C:\WINDOWS\system32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 896K, used 523K [0x10010000, 0x10100000, 0x109e0000)
  eden space 832K,  62% used [0x10010000, 0x10092cc8, 0x100e0000)
  from space 64K,   0% used [0x100e0000, 0x100e0078, 0x100f0000)
  to   space 64K,   0% used [0x100f0000, 0x100f0000, 0x10100000)
 tenured generation   total 11084K, used 7687K [0x109e0000, 0x114b3000, 0x18010000)
   the space 11084K,  69% used [0x109e0000, 0x11161ec0, 0x11162000, 0x114b3000)
 compacting perm gen  total 7680K, used 7474K [0x18010000, 0x18790000, 0x1c010000)
   the space 7680K,  97% used [0x18010000, 0x1875cb78, 0x1875cc00, 0x18790000)

Local Time = Mon Feb 21 17:44:14 2005
Elapsed Time = 7
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode)
#
# An error report file has been saved as hs_err_pid2364.log.
# Please refer to the file for further information.
#

But adding the JointHinge2 to a group solves this problem…

(oh yeah, delete still doesn’t work, even without the group)

DP

aha! If you enable feedback on that joint, it will cause that crash.

Its still a bug and i think it should be delt with, because I would like to implement breakable joints! and breakable joints need both, feedback and deletion…

DP

I second that. Haven’t got my breakable joints to work because of joint.delete() native crashes.

any idea why it’s crashing?

The code is pretty simple:


    public void delete() {
        Ode.dJointDestroy(jointId);
        deleted = true;
    }

And I think the jointId’s work for everything else.

darkprophet, are you using the debug API, I assume you are, but I hate error messages like that one:


 NOTE: We are unable to locate the function name symbol for the error
 just occurred. Please refer to release documentation for possible
 reason and solutions. 

On mac, when using the debug API I do actually get a nice C stacktrace in the error log. This was amazingly helpful when I was porting Odejava to OS X.

Will.