context : i am making a JavaNativeInterface for bullet softbody, and i was testing the finalization of softbodies and joints through the Garbage Collector
As the Garbage collector act a bit on instinct, i used to trigger fast(or soon) garbage collection of object by repeating the creation of a physics space, adding object and joints and let them run a little and then repeat.
And from time to time i got this error "SIGSEGV at [libbulletjme.so+0xd62ba] removeleaf(btDbvt*, btDbvtNode*)+0x36" (maybe systematically, depends on the garbage collection).
The error come from the ~btSoftRigidDynamicsWorld() at some point.
My question are :
does this issue is from my code (or can it be from bullet code ?)
do i need extra care when deleting btSoftRigidDynamicsWorld ? (other stuff than just delete(physicsWorld) ?)
I encounter the following error :
Code: Select all
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f094cf582ba, pid=2863, tid=139679545235200
#
# JRE version: OpenJDK Runtime Environment (8.0_91-b14) (build 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14)
# Java VM: OpenJDK 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libbulletjme.so+0xd62ba] removeleaf(btDbvt*, btDbvtNode*)+0x36
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x00007f09c0085000): JavaThread "Finalizer" daemon [_thread_in_native, id=2877, stack(0x00007f09ad9d1000,0x00007f09adad2000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000020
Registers:
RAX=0x0000000000000000, RBX=0x00007f093c105240, RCX=0x00007f094cef09f6, RDX=0x0000000000000000
RSP=0x00007f09adad06b0, RBP=0x00007f09adad0700, RSI=0x0000000000000000, RDI=0x00007f093c10e2c8
R8 =0x0000000000000300, R9 =0x00007f0934d5b5b0, R10=0x00007f09b07dd728, R11=0x0000000000000202
R12=0x0000000000000000, R13=0x00007f0955f742e0, R14=0x00007f09adad0960, R15=0x00007f09c0085000
RIP=0x00007f094cf582ba, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007f09adad06b0)
0x00007f09adad06b0: 0000000000000000 00007f093c10e2c8
0x00007f09adad06c0: 00007f09adad0700 00007f094cec403e
0x00007f09adad06d0: 00007f09adad0700 00007f09adad0730
0x00007f09adad06e0: 00007f09adad0700 00007f094cec4b48
0x00007f09adad06f0: 0000000033f50000 00007f09adad0730
0x00007f09adad0700: 00007f09adad0720 00007f094cf59811
0x00007f09adad0710: 0000000000000000 00007f093c10e2c8
0x00007f09adad0720: 00007f09adad0760 00007f094cef0a56
0x00007f09adad0730: 00007f094d26b610 00007f093c1089a0
0x00007f09adad0740: 00007f0933f50000 00007f093c10e2c0
0x00007f09adad0750: 0000000100000000 00007f0933f50000
0x00007f09adad0760: 00007f09adad07b0 00007f094cfd3ccd
0x00007f09adad0770: 0000000000000000 00007f093c108560
0x00007f09adad0780: 00007f09adad07b0 000000013c108648
0x00007f09adad0790: 00007f0934cb9720 00007f0933f50000
0x00007f09adad07a0: 00007f09adad07d0 00007f093c105240
0x00007f09adad07b0: 00007f09adad07d0 00007f094ced3cc4
0x00007f09adad07c0: 00007f09adad07e0 00007f093c108560
0x00007f09adad07d0: 00007f09adad0800 00007f094cff614d
0x00007f09adad07e0: 00007f09adad0800 00007f093c108560
0x00007f09adad07f0: 0000000000000000 00007f093c105240
0x00007f09adad0800: 00007f09adad0830 00007f094cf4d502
0x00007f09adad0810: 00007f09adad0830 00007f093c108560
0x00007f09adad0820: 00000000d6ae6230 00007f093c105240
0x00007f09adad0830: 00007f09adad0850 00007f094cf4d580
0x00007f09adad0840: 00000000d6b08748 00007f093c108560
0x00007f09adad0850: 00007f09adad0870 00007f094cf6fd60
0x00007f09adad0860: 00007f09adad08d8 00007f093c105240
0x00007f09adad0870: 00007f09adad08c0 00007f094d005d05
0x00007f09adad0880: 0000000000000000 00007f093c105240
0x00007f09adad0890: 00007f09adad0960 00007f09c00851e0
0x00007f09adad08a0: 00007f09af0fe6ee 00007f093c105240
Instructions: (pc=0x00007f094cf582ba)
0x00007f094cf5829a: 00 48 3b 45 b0 75 15 48 8b 45 b8 48 c7 00 00 00
0x00007f094cf582aa: 00 00 b8 00 00 00 00 e9 43 01 00 00 48 8b 45 b0
0x00007f094cf582ba: 48 8b 40 20 48 89 45 d0 48 8b 45 d0 48 8b 40 20
0x00007f094cf582ca: 48 89 45 c8 48 8b 45 b0 48 89 c7 e8 ce f9 ff ff
Register to memory mapping:
RAX=0x0000000000000000 is an unknown value
RBX=0x00007f093c105240 is an unknown value
RCX=0x00007f094cef09f6: <offset 0x6e9f6> in /home/dokthar/workspace-JME/SoftPhysics-Test/libbulletjme.so at 0x00007f094ce82000
RDX=0x0000000000000000 is an unknown value
RSP=0x00007f09adad06b0 is pointing into the stack for thread: 0x00007f09c0085000
RBP=0x00007f09adad0700 is pointing into the stack for thread: 0x00007f09c0085000
RSI=0x0000000000000000 is an unknown value
RDI=0x00007f093c10e2c8 is an unknown value
R8 =0x0000000000000300 is an unknown value
R9 =0x00007f0934d5b5b0 is an unknown value
R10=0x00007f09b07dd728 is at code_begin+808 in an Interpreter codelet
method entry point (kind = native) [0x00007f09b07dd400, 0x00007f09b07ddd00] 2304 bytes
R11=0x0000000000000202 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x00007f0955f742e0} 'finalizeNative' '(J)V' in 'com/jme3/bullet/PhysicsSpace'
R14=0x00007f09adad0960 is pointing into the stack for thread: 0x00007f09c0085000
R15=0x00007f09c0085000 is a thread
Stack: [0x00007f09ad9d1000,0x00007f09adad2000], sp=0x00007f09adad06b0, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libbulletjme.so+0xd62ba] removeleaf(btDbvt*, btDbvtNode*)+0x36
C [libbulletjme.so+0xd7811] btDbvt::remove(btDbvtNode*)+0x23
C [libbulletjme.so+0x6ea56] btDbvtBroadphase::destroyProxy(btBroadphaseProxy*, btDispatcher*)+0x60
C [libbulletjme.so+0x151ccd] btCollisionWorld::~btCollisionWorld()+0xb7
C [libbulletjme.so+0x51cc4] btDynamicsWorld::~btDynamicsWorld()+0x26
C [libbulletjme.so+0x17414d] btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld()+0x14b
C [libbulletjme.so+0xcb502] btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld()+0x8e
C [libbulletjme.so+0xcb580] btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld()+0x18
C [libbulletjme.so+0xedd60] jmePhysicsSpace::~jmePhysicsSpace()+0x38
C [libbulletjme.so+0x183d05] Java_com_jme3_bullet_PhysicsSpace_finalizeNative+0x37
j com.jme3.bullet.PhysicsSpace.finalizeNative(J)V+0
j com.jme3.bullet.PhysicsSpace.finalize()V+34
J 1439 C1 java.lang.ref.Finalizer.runFinalizer(Lsun/misc/JavaLangAccess;)V (62 bytes) @ 0x00007f09b0c8bfc4 [0x00007f09b0c8ba40+0x584]
J 1438 C1 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x00007f09b0c8b6dc [0x00007f09b0c8b680+0x5c]
j java.lang.ref.Finalizer$FinalizerThread.run()V+45
v ~StubRoutines::call_stub
V [libjvm.so+0x632f7a]
V [libjvm.so+0x630654]
V [libjvm.so+0x630c4a]
V [libjvm.so+0x67048e]
V [libjvm.so+0x9a0b70]
V [libjvm.so+0x8584a2]
C [libpthread.so.0+0x8184] start_thread+0xc4
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.jme3.bullet.PhysicsSpace.finalizeNative(J)V+0
j com.jme3.bullet.PhysicsSpace.finalize()V+34
J 1439 C1 java.lang.ref.Finalizer.runFinalizer(Lsun/misc/JavaLangAccess;)V (62 bytes) @ 0x00007f09b0c8bfc4 [0x00007f09b0c8ba40+0x584]
J 1438 C1 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x00007f09b0c8b6dc [0x00007f09b0c8b680+0x5c]
j java.lang.ref.Finalizer$FinalizerThread.run()V+45
v ~StubRoutines::call_stub
Memory: 4k page, physical 8131644k(403164k free), swap 8000508k(7919716k free)
vm_info: OpenJDK 64-Bit Server VM (25.91-b14) for linux-amd64 JRE (1.8.0_91-8u91-b14-0ubuntu4~14.04-b14), built on Apr 22 2016 12:27:31 by "buildd" with gcc 4.8.2
time: Mon Aug 1 21:50:19 2016
elapsed time: 49 seconds (0d 0h 0m 49s)