When trying to read a RigidBodyControl
from a saved file I’m experimenting the next crash:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f9fc6112126, pid=16658, tid=140324194694912
#
# JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build 1.8.0_77-b03)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libbulletjme.so+0x11c126] btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback*, btVector3 const&, btVector3 const&) const+0x1c
--------------- T H R E A D ---------------
Current thread (0x00007f9ff03f3000): JavaThread "jME3 Main" [_thread_in_native, id=16703, stack(0x00007f9fc5b73000,0x00007f9fc5c74000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000040
Registers:
RAX=0x0000000000000000, RBX=0x00007f9fc612da1c, RCX=0x00007f9fc5c71c00, RDX=0x00007f9fc5c71c10
RSP=0x00007f9fc5c71ae0, RBP=0x00007f9fc5c71b20, RSI=0x00007f9fc5c71b50, RDI=0x0000000000000000
R8 =0x00007f9fc5c71b68, R9 =0x00007f9fc5c71b6c, R10=0x0000000000000018, R11=0x00007f9ff6004648
R12=0x0000000000000000, R13=0x00007f9fb4d809d8, R14=0x00007f9fc5c71ea0, R15=0x00007f9ff03f3000
RIP=0x00007f9fc6112126, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007f9fc5c71ae0)
0x00007f9fc5c71ae0: 00007f9fc5c71c00 00007f9fc5c71c10
0x00007f9fc5c71af0: 00007f9fc5c71b50 0000000000000000
0x00007f9fc5c71b00: 00007f9fc5c71c60 00007f9fc5c71b50
0x00007f9fc5c71b10: 00007f9fc612da1c 0000000000000000
0x00007f9fc5c71b20: 00007f9fc5c71bb0 00007f9fc612da6f
0x00007f9fc5c71b30: 00007f9fc5c71c00 00007f9fc5c71c10
0x00007f9fc5c71b40: 00007f9fc5c71c60 00007f9f391d2ea0
0x00007f9fc5c71b50: 00007f9fc63c6a90 00007f9f391d5fe0
0x00007f9fc5c71b60: 00007f9fc5c71c60 00007f9fc60258f7
0x00007f9fc5c71b70: 00000000dd5e0b6b 00007f9fc5c71c00
0x00007f9fc5c71b80: dd5e0b6bc5c71d20 dd5e0b6bdd5e0b6b
0x00007f9fc5c71b90: dd5e0b6bdd5e0b6b 00000000dd5e0b6b
0x00007f9fc5c71ba0: 00007f9fc5c71be8 00007f9fc612da1c
0x00007f9fc5c71bb0: 00007f9fc5c71cf0 00007f9fc6030968
0x00007f9fc5c71bc0: 0000000000000000 0000000000000000
0x00007f9fc5c71bd0: 00007f9fc5c71d20 00007f9f391d2ea0
0x00007f9fc5c71be0: 0000000000000000 5d5e0b6b5d5e0b6b
0x00007f9fc5c71bf0: 00007f9fb4d80900 0000000000000000
0x00007f9fc5c71c00: 5d5e0b6b5d5e0b6b 000000005d5e0b6b
0x00007f9fc5c71c10: dd5e0b6bdd5e0b6b 00000000dd5e0b6b
0x00007f9fc5c71c20: 000000003f800000 0000000000000000
0x00007f9fc5c71c30: 3f80000000000000 0000000000000000
0x00007f9fc5c71c40: 0000000000000000 000000003f800000
0x00007f9fc5c71c50: 0000000000000000 0000000000000000
0x00007f9fc5c71c60: 00007f9fc63c4310 0000000000000000
0x00007f9fc5c71c70: 0000000000000000 000000003f800000
0x00007f9fc5c71c80: 0000000000000000 3f80000000000000
0x00007f9fc5c71c90: 0000000000000000 0000000000000000
0x00007f9fc5c71ca0: 000000003f800000 0000000000000000
0x00007f9fc5c71cb0: 0000000000000000 3f800000dd5e0b6b
0x00007f9fc5c71cc0: 0000000000000000 00007f9f00000000
0x00007f9fc5c71cd0: 00007f9fc5c71d30 00007f9fb4d809d8
Instructions: (pc=0x00007f9fc6112126)
0x00007f9fc6112106: ff c9 c3 90 55 48 89 e5 48 83 ec 40 48 89 7d d8
0x00007f9fc6112116: 48 89 75 d0 48 89 55 c8 48 89 4d c0 48 8b 45 d8
0x00007f9fc6112126: 0f b6 40 40 84 c0 0f 84 d0 00 00 00 48 8b 55 c8
0x00007f9fc6112136: 48 8d 75 e0 48 8b 45 d8 b9 00 00 00 00 48 89 c7
Register to memory mapping:
RAX=0x0000000000000000 is an unknown value
RBX=0x00007f9fc612da1c: <offset 0x137a1c> in /home/NemesisMate/jmonkeyprojects/BasicGame/libbulletjme.so at 0x00007f9fc5ff6000
RCX=0x00007f9fc5c71c00 is pointing into the stack for thread: 0x00007f9ff03f3000
RDX=0x00007f9fc5c71c10 is pointing into the stack for thread: 0x00007f9ff03f3000
RSP=0x00007f9fc5c71ae0 is pointing into the stack for thread: 0x00007f9ff03f3000
RBP=0x00007f9fc5c71b20 is pointing into the stack for thread: 0x00007f9ff03f3000
RSI=0x00007f9fc5c71b50 is pointing into the stack for thread: 0x00007f9ff03f3000
RDI=0x0000000000000000 is an unknown value
R8 =0x00007f9fc5c71b68 is pointing into the stack for thread: 0x00007f9ff03f3000
R9 =0x00007f9fc5c71b6c is pointing into the stack for thread: 0x00007f9ff03f3000
R10=0x0000000000000018 is an unknown value
R11=0x00007f9ff6004648: <offset 0xfb5648> in /home/NemesisMate/jmonkeyplatform/jdk/jre/lib/amd64/server/libjvm.so at 0x00007f9ff504f000
R12=0x0000000000000000 is an unknown value
R13={method} {0x00007f9fb4d809d8} 'setLocalScaling' '(JLcom/jme3/math/Vector3f;)V' in 'com/jme3/bullet/collision/shapes/CollisionShape'
R14=0x00007f9fc5c71ea0 is pointing into the stack for thread: 0x00007f9ff03f3000
R15=0x00007f9ff03f3000 is a thread
And it continues with the java stack trace:
Stack: [0x00007f9fc5b73000,0x00007f9fc5c74000], sp=0x00007f9fc5c71ae0, free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libbulletjme.so+0x11c126] btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback*, btVector3 const&, btVector3 const&) const+0x1c
C [libbulletjme.so+0x137a6f] btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const+0x53
C [libbulletjme.so+0x3a968] btTriangleMeshShape::localGetSupportingVertex(btVector3 const&) const+0x10c
C [libbulletjme.so+0x3a545] btTriangleMeshShape::recalcLocalAabb()+0x8f
C [libbulletjme.so+0x3a699] btTriangleMeshShape::setLocalScaling(btVector3 const&)+0x33
C [libbulletjme.so+0x137b16] btBvhTriangleMeshShape::setLocalScaling(btVector3 const&)+0x78
C [libbulletjme.so+0xa6d2f] Java_com_jme3_bullet_collision_shapes_CollisionShape_setLocalScaling+0x9b
j com.jme3.bullet.collision.shapes.CollisionShape.setLocalScaling(JLcom/jme3/math/Vector3f;)V+0
j com.jme3.bullet.collision.shapes.CollisionShape.setScale(Lcom/jme3/math/Vector3f;)V+15
j com.jme3.bullet.collision.shapes.MeshCollisionShape.createShape(Z)V+103
j com.jme3.bullet.collision.shapes.MeshCollisionShape.read(Lcom/jme3/export/JmeImporter;)V+131
J 1367 C1 com.jme3.export.binary.BinaryImporter.readObject(I)Lcom/jme3/export/Savable; (347 bytes) @ 0x00007f9fe105643c [0x00007f9fe1054b20+0x191c]
J 1358 C1 com.jme3.export.binary.BinaryInputCapsule.readSavable(Ljava/lang/String;Lcom/jme3/export/Savable;)Lcom/jme3/export/Savable; (111 bytes) @ 0x00007f9fe105046c [0x00007f9fe104fa60+0xa0c]
j com.jme3.bullet.collision.PhysicsCollisionObject.read(Lcom/jme3/export/JmeImporter;)V+38
j com.jme3.bullet.objects.PhysicsRigidBody.read(Lcom/jme3/export/JmeImporter;)V+2
j com.jme3.bullet.control.RigidBodyControl.read(Lcom/jme3/export/JmeImporter;)V+2
J 1367 C1 com.jme3.export.binary.BinaryImporter.readObject(I)Lcom/jme3/export/Savable; (347 bytes) @ 0x00007f9fe105643c [0x00007f9fe1054b20+0x191c]
j com.jme3.export.binary.BinaryImporter.load(Ljava/io/InputStream;Lcom/jme3/export/ReadListener;Ljava/io/ByteArrayOutputStream;)Lcom/jme3/export/Savable;+631
j com.jme3.export.binary.BinaryImporter.load(Ljava/io/InputStream;)Lcom/jme3/export/Savable;+4
j com.jme3.export.binary.BinaryImporter.load(Lcom/jme3/asset/AssetInfo;)Ljava/lang/Object;+17
j com.jme3.asset.DesktopAssetManager.loadLocatedAsset(Lcom/jme3/asset/AssetKey;Lcom/jme3/asset/AssetInfo;Lcom/jme3/asset/AssetProcessor;Lcom/jme3/asset/cache/AssetCache;)Ljava/lang/Object;+21
j com.jme3.asset.DesktopAssetManager.loadAsset(Lcom/jme3/asset/AssetKey;)Ljava/lang/Object;+189
j com.jme3.asset.DesktopAssetManager.loadAsset(Ljava/lang/String;)Ljava/lang/Object;+9
If I’m not wrong, the problem comes when in MeshCollisionShape.class
the read method tries to set the native scale:
private void createShape(boolean buildBvt) {
this.meshId = NativeMeshUtil.createTriangleIndexVertexArray(this.triangleIndexBase, this.vertexBase, this.numTriangles, this.numVertices, this.vertexStride, this.triangleIndexStride);
Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Mesh {0}", Long.toHexString(this.meshId));
this.objectId = createShape(memoryOptimized, buildBvt, this.meshId);
Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(this.objectId));
this.setScale(this.scale);
this.setMargin(this.margin);
}
The saved scale is: (2.813861, 2.813861, 2.3507693)
, or at least that is what I print just before writing it to file. I’m not sure what can be causing the crash.
Anyone has any idea about what can be the root cause of the crash?, thanks in advance.
Note: It works for lots of physics objects but this one.
Note: the scale printing is done with physicsControl.getCollisionShape().getScale()
.