App crashes on one phone but not another

The thing is my game runs perfectly well on my phone (HTC desire 300, android 4.1.2) but gets random crashes on my brother’s Samsung Galaxy Note 3. Naturally, I plugged his phone in and ran the game through the debugger and the only thing I could find of significance was this:

F/art (10282): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: the return type of CallVoidMethodV does not match boolean java.util.List.add(java.lang.Object)
F/art (10282): art/runtime/check_jni.cc:65] in call to CallVoidMethodV
F/art (10282): art/runtime/check_jni.cc:65] from void com.jme3.bullet.PhysicsSpace.rayTest_native(com.jme3.math.Vector3f, com.jme3.math.Vector3f, long, java.util.List)
F/art (10282): art/runtime/check_jni.cc:65] “GLThread 229602” prio=5 tid=4 Runnable
F/art (10282): art/runtime/check_jni.cc:65] | group=“main” sCount=0 dsCount=0 obj=0x12c062a0 self=0xaedf1000
F/art (10282): art/runtime/check_jni.cc:65] | sysTid=10303 nice=0 cgrp=apps sched=0/0 handle=0xaedb8700
F/art (10282): art/runtime/check_jni.cc:65] | state=R schedstat=( 2672616711 1113587564 2723 ) utm=221 stm=46 core=3 HZ=100
F/art (10282): art/runtime/check_jni.cc:65] | stack=0xb39fe000-0xb3a00000 stackSize=1036KB
F/art (10282): art/runtime/check_jni.cc:65] | held mutexes= “mutator lock”(shared held)
F/art (10282): art/runtime/check_jni.cc:65] native: #00 pc 00004640 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art (10282): art/runtime/check_jni.cc:65] native: #01 pc 00002e8d /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art (10282): art/runtime/check_jni.cc:65] native: #02 pc 002475d9 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits >&, int, char const*, art::mirror::ArtMethod*)+68)
F/art (10282): art/runtime/check_jni.cc:65] native: #03 pc 0022c3d3 /system/lib/libart.so (art::thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+146)
F/art (10282): art/runtime/check_jni.cc:65] native: #04 pc 000b11e3 /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
F/art (10282): art/runtime/check_jni.cc:65] native: #05 pc 000b191d /system/lib/libart.so (art::JniAbortF(char const*, char const*, …)+60)
F/art (10282): art/runtime/check_jni.cc:65] native: #06 pc 000b22d3 /system/lib/libart.so (art::ScopedCheck::CheckSig(_jmethodID*, char const*, bool) (.constprop.130)+266)
F/art (10282): art/runtime/check_jni.cc:65] native: #07 pc 000bbf05 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+60)
F/art (10282): art/runtime/check_jni.cc:65] native: #08 pc 00050789 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, …)+20)
F/art (10282): art/runtime/check_jni.cc:65] native: #09 pc 00052a25 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (jmeBulletUtil::addResult(_JNIEnv*, _jobject*, btVector3, btVector3, float, btCollisionObject const*)+140)
F/art (10282): art/runtime/check_jni.cc:65] native: #10 pc 00051e15 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (???)
F/art (10282): art/runtime/check_jni.cc:65] native: #11 pc 00062b27 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (???)
F/art (10282): art/runtime/check_jni.cc:65] native: #12 pc 00065611 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btCollisionWorld::rayTestSingleInternal(btTransform const&, btTransform const&, btCollisionObjectWrapper const*, btCollisionWorld::RayResultCallback&)+1260)
F/art (10282): art/runtime/check_jni.cc:65] native: #13 pc 0006575d /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (???)
F/art (10282): art/runtime/check_jni.cc:65] native: #14 pc 0006577d /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (???)
F/art (10282): art/runtime/check_jni.cc:65] native: #15 pc 000648d1 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btDbvt::rayTest(btDbvtNode const*, btVector3 const&, btVector3 const&, btDbvt::ICollide&)+752)
F/art (10282): art/runtime/check_jni.cc:65] native: #16 pc 000654e1 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btCollisionWorld::rayTestSingleInternal(btTransform const&, btTransform const&, btCollisionObjectWrapper const*, btCollisionWorld::RayResultCallback&)+956)
F/art (10282): art/runtime/check_jni.cc:65] native: #17 pc 00065799 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btCollisionWorld::rayTestSingle(btTransform const&, btTransform const&, btCollisionObject*, btCollisionShape const*, btTransform const&, btCollisionWorld::RayResultCallback&)+20)
F/art (10282): art/runtime/check_jni.cc:65] native: #18 pc 000657e9 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btSingleRayCallback::process(btBroadphaseProxy const*)+72)
F/art (10282): art/runtime/check_jni.cc:65] native: #19 pc 0005861b /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (BroadphaseRayTester::Process(btDbvtNode const*)+10)
F/art (10282): art/runtime/check_jni.cc:65] native: #20 pc 0005973b /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btDbvt::rayTestInternal(btDbvtNode const*, btVector3 const&, btVector3 const&, btVector3 const&, unsigned int*, float, btVector3 const&, btVector3 const&, btDbvt::ICollide&) const+670)
F/art (10282): art/runtime/check_jni.cc:65] native: #21 pc 00059843 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btDbvtBroadphase::rayTest(btVector3 const&, btVector3 const&, btBroadphaseRayCallback&, btVector3 const&, btVector3 const&)+74)
F/art (10282): art/runtime/check_jni.cc:65] native: #22 pc 000645d7 /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (btCollisionWorld::rayTest(btVector3 const&, btVector3 const&, btCollisionWorld::RayResultCallback&) const+78)
F/art (10282): art/runtime/check_jni.cc:65] native: #23 pc 000523eb /data/app/com.renewablegames.duckyinspace-2/lib/arm/libbulletjme.so (Java_com_jme3_bullet_PhysicsSpace_rayTest_1native+126)
F/art (10282): art/runtime/check_jni.cc:65] native: #24 pc 001c76f9 /data/dalvik-cache/arm/data@app@com.renewablegames.duckyinspace-2@base.apk@classes.dex (Java_com_jme3_bullet_PhysicsSpace_rayTest_1native__Lcom_jme3_math_Vector3f_2Lcom_jme3_math_Vector3f_2JLjava_util_List_2+168)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.rayTest_native(Native method)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.rayTest(PhysicsSpace.java:796)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.rayTest(PhysicsSpace.java:786)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.control.BetterCharacterControl.checkOnGround(BetterCharacterControl.java:468)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.control.BetterCharacterControl.prePhysicsTick(BetterCharacterControl.java:166)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.preTick_native(PhysicsSpace.java:207)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.stepSimulation(Native method)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:357)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:343)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.bullet.BulletAppState.render(BulletAppState.java:257)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.app.state.AppStateManager.render(AppStateManager.java:300)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.app.SimpleApplication.update(SimpleApplication.java:251)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.app.AndroidHarness.update(AndroidHarness.java:467)
F/art (10282): art/runtime/check_jni.cc:65] at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:349)
F/art (10282): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1531)
F/art (10282): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
F/art (10282): art/runtime/check_jni.cc:65]

which does not happen on my HTC desire. Im running jme 3.0 stable. The full log is on pastebin here: http://pastebin.com/xAXaSZ85

Thanks for your time.

Fixed in GitHub:

1 Like

I thought I would post again in this thread instead of the thread I’d made for the game (Ducky In Space). After @Momoko_fan has fixed the raytest JNI crash in github, I removed all raytests and found workarounds then released the game, however it is still frequently crashing and this time I cannot find the culprit, in the logcat there is no stacktrace, only from what I can see the death message. Can anyone make sense of these logs? There are two separate ones on pastebin from separate runs straight from JMP debugger… I feel so helpless…

Thank you

EDIT: I know people have better things to do than trawl through logs. I don’t really know what I’m doing here like I said, I don’t really know android, but I found this:
I/SurfaceFlinger( 266): id=3051 Removed euckyinspac (9/14)
I/SurfaceFlinger( 266): id=3051 Removed euckyinspac (-2/14)

in the logs (line 807 & 808 first log)
but after this there are references to duckyinspace, an ad request for it etc. Could it be that the game is still working but it appears to hang because the screen isn’t updating? Also the log spelt the game’s name wrong… Maybe its supposed to.

This message

D/AndroidHarness(26839): Resolution from Window, width:1080, height: 1920

comes from jME3. After this it sets a bunch of settings and then initializes the application. There’s a try/catch statement there to catch all exceptions, which it will show to the user in a nice dialog. This never happens, so I am guessing the crash is in native code somewhere…

By the way, is this using jME 3.0 or 3.1?
Also does it crash on boot or while running? Its not clear from your post.

Thanks for taking a look. No dialogue appears on the phone, the app just hangs. It can be played for a couple of seconds, sometimes longer, sometimes less and it just hangs at the loading screen, but its almost always early on. You have to forcequit it. It is a Galxy note 3 so that is the correct resolution. It is JME 3.0, however it does feel like 3.1 because of all the crashes :confused:

EDIT: Also had this crash report in my google developers account this morning, its from a HTC One android 5.0, looks like the same thing as with the raytests.


Build fingerprint: ‘htc/sprint_wwe/m7wls:5.0.2/LRX22G/499067.7:user/release-keys’
Revision: ‘4’
ABI: ‘arm’
pid: 30345, tid: 30364, name: GLThread 44246 >>> com.renewablegames.duckyinspace <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Abort message: ‘art/runtime/gc/collector/mark_sweep.cc:381] Can’t mark invalid object’
r0 b9908d98 r1 b9908dd0 r2 00001002 r3 00000000
r4 b9908d98 r5 b98d2ab8 r6 b985e658 r7 b52cbc74
r8 b0300038 r9 b02fffc8 sl b9446938 fp b02fffe8
ip b9908d9c sp b02fff58 lr b507f44d pc b5203e2a cpsr 60070030

backtrace:
#00 pc 00228e2a /system/lib/libart.so (art::thread::DumpState(std::__1::basic_ostream<char, std::__1::char_traits >&, art::Thread const*, int)+165)
#01 pc 002297ed /system/lib/libart.so (art::thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+12)
#02 pc 00232165 /system/lib/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits >&)+104)
#03 pc 0021a705 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&)+236)
#04 pc 0021a951 /system/lib/libart.so (art::Runtime::Abort()+72)
#05 pc 000a5de7 /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
#06 pc 00123719 /system/lib/libart.so (bool art::gc::accounting::HeapBitmap::AtomicTestAndSetart::gc::collector::MarkSweepMarkObjectSlowPath(art::mirror::Object const*, art::gc::collector::MarkSweepMarkObjectSlowPath const&)+420)
#07 pc 001237dd /system/lib/libart.so (art::gc::collector::MarkSweep::MarkObjectParallel(art::mirror::Object const*)+128)
#08 pc 00124897 /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootParallelCallback(art::mirror::Object**, void*, unsigned int, art::RootType)+14)
#09 pc 0022d911 /system/lib/libart.so (art::ReferenceMapVisitorart::RootCallbackVisitor::VisitQuickFrame()+800)
#10 pc 0022dc1d /system/lib/libart.so (art::ReferenceMapVisitorart::RootCallbackVisitor::VisitFrame()+128)
#11 pc 002227f5 /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+252)
#12 pc 002242cf /system/lib/libart.so (art::thread::VisitRoots(void ()(art::mirror::Object**, void, unsigned int, art::RootType), void*)+702)
#13 pc 00123949 /system/lib/libart.so (art::gc::collector::CheckpointMarkThreadRoots::Run(art::Thread*)+116)
#14 pc 0022470d /system/lib/libart.so (art::thread::RunCheckpointFunction()+172)
#15 pc 0027d9d1 /system/lib/libart.so (art::GoToRunnable(art::Thread*)+312)
#16 pc 00086631 /system/lib/libart.so (art::JniMethodEnd(unsigned int, art::Thread*)+8)
#17 pc 0008c34b /data/dalvik-cache/arm/system@framework@boot.oat

Haha, that was me who reported that :slight_smile: I hit send error report when the game crashed. Looks like a complicated error

After a not so quick search on google, it seems this error can either be caused by a bug in Android, or misuse of JNI API. Does it occur with JBullet too or only native bullet?

Also, if you’re using native bullet, try changing the threading mode to sequential, like this:

bulletState.setThreadingType(ThreadingType.SEQUENTIAL);

This makes sure all native calls occur in the same thread, so less chance of race conditions and such.

I’m just using whichever version of bullet is set by default. Its a fairly simple application I’ve not messed with anything to do with jni or bullet. I’ll try testing with the other version of bullet, I don’t know if I’m using native or jbullet and try the sequential thing you mentioned.

How do I fix that on my 3.1 Alpha SDK