MeshCollisionShape causes Signal 11 crash

Hello

Firstly great work on Android support for jme!



I run into a problem on a nexus 7 (Android 4.2). The jme test Apps on the market work all fine to my tablet.

However when I try to run one app from SKD I get onto this error and app crashes.



Seems to be an error with MeshCollisionShape, any ideas of what could be causing it ?

thnx :slight_smile:



/dalvikvm(29400): GC_CONCURRENT freed 784K, 21% free 13886K/17548K, paused 4ms+4ms, total 57ms

D/dalvikvm(29400): WAIT_FOR_CONCURRENT_GC blocked 48ms

I/dalvikvm-heap(29400): Grow heap (frag case) to 17.704MB for 4194320-byte allocation

D/dalvikvm(29400): GC_FOR_ALLOC freed 71K, 18% free 17911K/21648K, paused 46ms, total 46ms

D/dalvikvm(29400): GC_CONCURRENT freed 26K, 18% free 17912K/21648K, paused 2ms+3ms, total 59ms

I/CapsuleCollisionShape(29400): INFO CapsuleCollisionShape 11:57:31 AM Created Shape 675acab0

I/CharacterControl(29400): INFO PhysicsCharacter 11:57:31 AM Creating GhostObject 65d64230

I/CharacterControl(29400): INFO PhysicsCollisionObject 11:57:31 AM initUserPointer() objectId = 65d64230

I/CharacterControl(29400): INFO PhysicsCharacter 11:57:31 AM Creating Character 65d64148

I/CharacterControl(29400): INFO PhysicsCharacter 11:57:31 AM Creating GhostObject 68064160

I/CharacterControl(29400): INFO PhysicsCollisionObject 11:57:31 AM initUserPointer() objectId = 68064160

I/CharacterControl(29400): INFO PhysicsCharacter 11:57:31 AM Creating Character 68a03c48

I/RigidBodyMotionState(29400): INFO RigidBodyMotionState 11:57:31 AM Created MotionState 65d55e50

I/CompoundCollisionShape(29400): INFO CompoundCollisionShape 11:57:31 AM Created Shape 65d63de0

I/BoxCollisionShape(29400): INFO BoxCollisionShape 11:57:31 AM Created Shape 65d55a60

I/MeshCollisionShape(29400): INFO MeshCollisionShape 11:57:31 AM Created Mesh 685ac050

F/libc (29400): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 29770 (Thread-2485) <<<<<<<<<<<<<<<<<<<<

I/DEBUG ( 124): *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG ( 124): Build fingerprint: ‘google/nakasi/grouper:4.2.1/JOP40D/533553:user/release-keys’

I/DEBUG ( 124): Revision: ‘0’

I/DEBUG ( 124): pid: 29400, tid: 29770, name: Thread-2485 >>> edu.testApp.android <<<

I/DEBUG ( 124): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000

I/DEBUG ( 124): r0 00000000 r1 00000000 r2 0000000c r3 00000000

I/DEBUG ( 124): r4 6c017a80 r5 00000000 r6 00000000 r7 00000000

I/DEBUG ( 124): r8 685ac050 r9 6c0179f8 sl 00000001 fp 6c017a44

I/DEBUG ( 124): ip 00000000 sp 6c0179c0 lr 695396df pc 69539816 cpsr 48000030

I/DEBUG ( 124): d0 0000000340400000 d1 40162e4240400000

I/DEBUG ( 124): d2 3fe0ae00d1cfdeb4 d3 65d4c70065d4c680

I/DEBUG ( 124): d4 0000000000000000 d5 000000003f800000

I/DEBUG ( 124): d6 0000000000000000 d7 dd5e0b6b00000000

I/DEBUG ( 124): d8 3f8000003f800000 d9 000000003f800000

I/DEBUG ( 124): d10 3fe136b53f350014 d11 3f800000400b3c64

I/DEBUG ( 124): d12 3f8000003f800000 d13 0000000000000000

I/DEBUG ( 124): d14 0000000000000000 d15 0000000000000000

I/DEBUG ( 124): d16 0000000000000001 d17 3fe62e42fee00000

I/DEBUG ( 124): d18 3f6c5894d10d4986 d19 40162e42fefa39ef

I/DEBUG ( 124): d20 4010000000000000 d21 3fae1e1e1e1e1e1e

I/DEBUG ( 124): d22 3fcc71d47f090650 d23 3fd2492db5d42ea3

I/DEBUG ( 124): d24 3fd999a4c27df49e d25 3fe5555c81e9632d

I/DEBUG ( 124): d26 ffffa7e6ffffa7e6 d27 0000000200000002

I/DEBUG ( 124): d28 000000a4000000a3 d29 000000cf000000ce

I/DEBUG ( 124): d30 000000cc000000ca d31 000000a1000000a0

I/DEBUG ( 124): scr 20000090

I/DEBUG ( 124):

I/DEBUG ( 124): backtrace:

I/DEBUG ( 124): #00 pc 0007d816 /data/app-lib/edu.testApp.android-1/libbulletjme.so (btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback
, btVector3 const&, btVector3 const&) const+473)

I/DEBUG ( 124): #01 pc 0007fc75 /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::processAllTriangles(btTriangleCallback
, btVector3 const&, btVector3 const&) const+56)

I/DEBUG ( 124): #02 pc 0007fbad /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::localGetSupportingVertex(btVector3 const&) const+152)

I/DEBUG ( 124): #03 pc 0007f8f3 /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::recalcLocalAabb()+70)

I/DEBUG ( 124): #04 pc 0007fd9d /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::btTriangleMeshShape(btStridingMeshInterface
)+40)

I/DEBUG ( 124): #05 pc 00071209 /data/app-lib/edu.testApp.android-1/libbulletjme.so (btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface*, bool, bool)+12)

I/DEBUG ( 124): #06 pc 0004d5e9 /data/app-lib/edu.testApp.android-1/libbulletjme.so (Java_com_jme3_bullet_collision_shapes_MeshCollisionShape_createShape+24)

I/DEBUG ( 124): #07 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112)

I/DEBUG ( 124): #08 pc 0004d411 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396)

I/DEBUG ( 124): #09 pc 0004f56f /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174)

I/DEBUG ( 124): #10 pc 000276a0 /system/lib/libdvm.so

I/DEBUG ( 124): #11 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)

I/DEBUG ( 124): #12 pc 0005fc31 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)

I/DEBUG ( 124): #13 pc 0005fc5b /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, …)+20)

I/DEBUG ( 124): #14 pc 000547d7 /system/lib/libdvm.so

I/DEBUG ( 124): #15 pc 0000e3d8 /system/lib/libc.so (__thread_entry+72)

I/DEBUG ( 124): #16 pc 0000dac4 /system/lib/libc.so (pthread_create+160)

I/DEBUG ( 124):

I/DEBUG ( 124): stack:

I/DEBUG ( 124): 6c017980 0000ffff

I/DEBUG ( 124): 6c017984 00000000

I/DEBUG ( 124): 6c017988 00000002

I/DEBUG ( 124): 6c01798c 407277a1 /system/lib/libicui18n.so (icu_48::DecimalFormat::subformat(icu_48::UnicodeString&, icu_48::FieldPositionHandler&, icu_48::DigitList&, signed char) const+2028)

I/DEBUG ( 124): 6c017990 00000000

I/DEBUG ( 124): 6c017994 00000000

I/DEBUG ( 124): 6c017998 00000000

I/DEBUG ( 124): 6c01799c 6937557f /data/dalvik-cache/data@app@edu.testApp.android-1.apk@classes.dex

I/DEBUG ( 124): 6c0179a0 00000000

I/DEBUG ( 124): 6c0179a4 00000003

I/DEBUG ( 124): 6c0179a8 6c017b68

I/DEBUG ( 124): 6c0179ac 00000000

I/DEBUG ( 124): 6c0179b0 0010ffff

I/DEBUG ( 124): 6c0179b4 6c017a80

I/DEBUG ( 124): 6c0179b8 df0027ad

I/DEBUG ( 124): 6c0179bc 00000000

I/DEBUG ( 124): #00 6c0179c0 6c017a30

I/DEBUG ( 124): 6c0179c4 6c017a40

I/DEBUG ( 124): 6c0179c8 6c017a3c

I/DEBUG ( 124): 6c0179cc 6c017a28

I/DEBUG ( 124): 6c0179d0 6c017a34

I/DEBUG ( 124): 6c0179d4 00000000

I/DEBUG ( 124): 6c0179d8 00000000

I/DEBUG ( 124): 6c0179dc 6c017a28

I/DEBUG ( 124): 6c0179e0 6c017a2c

I/DEBUG ( 124): 6c0179e4 6c017a30

I/DEBUG ( 124): 6c0179e8 6c017a34

I/DEBUG ( 124): 6c0179ec 6c017a38

I/DEBUG ( 124): 6c0179f0 6c017a3c

I/DEBUG ( 124): 6c0179f4 6c017a40

I/DEBUG ( 124): 6c0179f8 00000034

I/DEBUG ( 124): 6c0179fc 00000035

I/DEBUG ( 124): … …

I/DEBUG ( 124): #01 6c017a80 695a3d28 /data/app-lib/edu.testApp.android-1/libbulletjme.so

I/DEBUG ( 124): 6c017a84 6c017ac0

I/DEBUG ( 124): 6c017a88 dd5e0b6b

I/DEBUG ( 124): 6c017a8c dd5e0b6b

I/DEBUG ( 124): 6c017a90 dd5e0b6b

I/DEBUG ( 124): 6c017a94 00000000

I/DEBUG ( 124): 6c017a98 5d5e0b6b /dev/ashmem/dalvik-mark-stack (deleted)

I/DEBUG ( 124): 6c017a9c 5d5e0b6b /dev/ashmem/dalvik-mark-stack (deleted)

I/DEBUG ( 124): 6c017aa0 5d5e0b6b /dev/ashmem/dalvik-mark-stack (deleted)

I/DEBUG ( 124): 6c017aa4 00000000

I/DEBUG ( 124): 6c017aa8 00000000

I/DEBUG ( 124): 6c017aac 6c017bc8

I/DEBUG ( 124): 6c017ab0 0006959a

I/DEBUG ( 124): 6c017ab4 65d55cf0

I/DEBUG ( 124): 6c017ab8 6953bc3d /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const)

I/DEBUG ( 124): 6c017abc 6953bbaf /data/app-lib/edu.testApp.android-1/libbulletjme.so (btTriangleMeshShape::localGetSupportingVertex(btVector3 const&) const+154)

I/DEBUG ( 124): #02 6c017ac0 695a3d10 /data/app-lib/edu.testApp.android-1/libbulletjme.so

I/DEBUG ( 124): 6c017ac4 00000000

I/DEBUG ( 124): 6c017ac8 00000000

I/DEBUG ( 124): 6c017acc 00000000

I/DEBUG ( 124): 6c017ad0 00000000

I/DEBUG ( 124): 6c017ad4 3f800000

I/DEBUG ( 124): 6c017ad8 00000000

I/DEBUG ( 124): 6c017adc 00000000

I/DEBUG ( 124): 6c017ae0 00000000

I/DEBUG ( 124): 6c017ae4 00000000

I/DEBUG ( 124): 6c017ae8 3f800000

I/DEBUG ( 124): 6c017aec 00000000

I/DEBUG ( 124): 6c017af0 00000000

I/DEBUG ( 124): 6c017af4 00000000

I/DEBUG ( 124): 6c017af8 00000000

I/DEBUG ( 124): 6c017afc 3f800000

I/DEBUG ( 124): … …

I/DEBUG ( 124):

I/DEBUG ( 124): memory near r4:

I/DEBUG ( 124): 6c017a60 695a3d28 6953963d 6c017b88 65d55cf0

I/DEBUG ( 124): 6c017a70 6c017bb8 675ac548 6c017c64 6953bc77

I/DEBUG ( 124): 6c017a80 695a3d28 6c017ac0 dd5e0b6b dd5e0b6b

I/DEBUG ( 124): 6c017a90 dd5e0b6b 00000000 5d5e0b6b 5d5e0b6b

I will just state the obvious as normen is better to answer this, have you got the latest stable update? Can u show the code where you create the meshcollisionshape, and does the app work fine if u remove that code?

Actually it sounds for me as the mesh is invalid form the stacktrace.

→ You sure it is valid?

→ eg no invalid indexes ect?

→ Grafficcards ususally are able to render even corrupted meshes, so this does not gurantee that it is valid.

1 Like

Thanks for your answers,

@ Empire Phoenix: Your were probably right, I was using an imported model from blender and there must be an issue with meshes when adding the StaticRigidBody control.



I used a Box geometry as below and worked great.



Material material = new Material(this.assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);

material.setTexture(“ColorMap”, this.assetManager.loadTexture(“Textures/Land/land.jpg”));

Box floorBox = new Box(140, 20f, 140);

Geometry floorGeometry = new Geometry(“Plane”, floorBox);

floorGeometry.setMaterial(material);

floorGeometry.setLocalTranslation(0, -3, 0);

floorGeometry.addControl(new RigidBodyControl(0));





The issue would now be how to check the mesh from blender exported models (I do make sure that the textures are UV Mapped). Its probably some property that I am not setting correctly. If someone knows where to find sample blender models would be great.



Note, I tried both importing the .blend file and using the OgreMesh extractor from blender, still getting the same signal 11 error on my android device. Note that no such problem is encountered on the PC

A box and Sphere are automatically converted to a Simple Collision Shape (BoxCollisionShape and SphereCollisionShape respectively), they aren’t MeshCollisionShapes.



You can try another shape, torus or something, and that give you a MeshCollisionShape. Use this instead of your box and see if it crashes with that:

[java]PQTorus mesh = new PQTorus(5,3, 2f, 1f, 32, 32); // Spiral torus [/java]



i just took it from the wiki

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:shape



And if that works try and put the geometry into a Node and call [java]node.addControl (new RigidBodyControl (0));[/java] instead of doing that on the geometry itself. This might show that it is MeshCollisionShapes inside CompoundCollisionShapes which are the issue.

1 Like

I’ve got the same error with a blender model, but then with a PhysicsControl created with the SceneComposer. It also works correctly on the PC.

Thanks wezrule, I tried what you suggested at it worked



[java]

Material material = new Material(this.assetManager, "Common/MatDefs/Misc/Unshaded.j3md");

material.setTexture("ColorMap", this.assetManager.loadTexture("Textures/Land/land.jpg"));

PQTorus mesh = new PQTorus(5,3, 2f, 1f, 32, 32); // Spiral torus

Geometry geom = new Geometry("A shape", mesh); // wrap shape into geometry

geom.setMaterial(material);

geom.setLocalTranslation(0,0,0);



Node testNode = new Node();

testNode.attachChild(geom);

testNode.addControl (new RigidBodyControl (0));

root.attachChild(testNode);

[/java]



However when I try with the blender exported model I get the same signall 11 error. I guess my exported mesh seems to have a problem (although its a simple plane model). E.g when I try the following



[java]

root = (Node) assetManager.loadModel(name);

Node testNode = new Node();

testNode.addControl (new RigidBodyControl (0));

root.attachChild(testNode);

[/java]

Well what you can do for a test.

→ Physic engine cares only about position and index buffer.

Get Both buffers from the Model → geometry(s) → Mesh(es)

position is 4byte floats * 3 → eg vector3f

index is 4byte integer



now write a small test program, that checks that each index points to a real vector.

indexbuffer is 1,2,3

so test if you have 3 Vector3f in the position buffer.



What i suspect that you have like 1k vectors but a index that points to index 5k or a incomplete vertex, eg only two floats.

This issue is still there. Has anybody experienced this too ?