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/] 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/] in call to CallVoidMethodV
F/art (10282): art/runtime/] 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/] “GLThread 229602” prio=5 tid=4 Runnable
F/art (10282): art/runtime/] | group=“main” sCount=0 dsCount=0 obj=0x12c062a0 self=0xaedf1000
F/art (10282): art/runtime/] | sysTid=10303 nice=0 cgrp=apps sched=0/0 handle=0xaedb8700
F/art (10282): art/runtime/] | state=R schedstat=( 2672616711 1113587564 2723 ) utm=221 stm=46 core=3 HZ=100
F/art (10282): art/runtime/] | stack=0xb39fe000-0xb3a00000 stackSize=1036KB
F/art (10282): art/runtime/] | held mutexes= “mutator lock”(shared held)
F/art (10282): art/runtime/] native: #00 pc 00004640 /system/lib/ (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art (10282): art/runtime/] native: #01 pc 00002e8d /system/lib/ (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art (10282): art/runtime/] native: #02 pc 002475d9 /system/lib/ (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits >&, int, char const*, art::mirror::ArtMethod*)+68)
F/art (10282): art/runtime/] native: #03 pc 0022c3d3 /system/lib/ (art::thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+146)
F/art (10282): art/runtime/] native: #04 pc 000b11e3 /system/lib/ (art::JniAbort(char const*, char const*)+582)
F/art (10282): art/runtime/] native: #05 pc 000b191d /system/lib/ (art::JniAbortF(char const*, char const*, …)+60)
F/art (10282): art/runtime/] native: #06 pc 000b22d3 /system/lib/ (art::ScopedCheck::CheckSig(_jmethodID*, char const*, bool) (.constprop.130)+266)
F/art (10282): art/runtime/] native: #07 pc 000bbf05 /system/lib/ (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+60)
F/art (10282): art/runtime/] native: #08 pc 00050789 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, …)+20)
F/art (10282): art/runtime/] native: #09 pc 00052a25 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (jmeBulletUtil::addResult(_JNIEnv*, _jobject*, btVector3, btVector3, float, btCollisionObject const*)+140)
F/art (10282): art/runtime/] native: #10 pc 00051e15 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (???)
F/art (10282): art/runtime/] native: #11 pc 00062b27 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (???)
F/art (10282): art/runtime/] native: #12 pc 00065611 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btCollisionWorld::rayTestSingleInternal(btTransform const&, btTransform const&, btCollisionObjectWrapper const*, btCollisionWorld::RayResultCallback&)+1260)
F/art (10282): art/runtime/] native: #13 pc 0006575d /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (???)
F/art (10282): art/runtime/] native: #14 pc 0006577d /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (???)
F/art (10282): art/runtime/] native: #15 pc 000648d1 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btDbvt::rayTest(btDbvtNode const*, btVector3 const&, btVector3 const&, btDbvt::ICollide&)+752)
F/art (10282): art/runtime/] native: #16 pc 000654e1 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btCollisionWorld::rayTestSingleInternal(btTransform const&, btTransform const&, btCollisionObjectWrapper const*, btCollisionWorld::RayResultCallback&)+956)
F/art (10282): art/runtime/] native: #17 pc 00065799 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btCollisionWorld::rayTestSingle(btTransform const&, btTransform const&, btCollisionObject*, btCollisionShape const*, btTransform const&, btCollisionWorld::RayResultCallback&)+20)
F/art (10282): art/runtime/] native: #18 pc 000657e9 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btSingleRayCallback::process(btBroadphaseProxy const*)+72)
F/art (10282): art/runtime/] native: #19 pc 0005861b /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (BroadphaseRayTester::Process(btDbvtNode const*)+10)
F/art (10282): art/runtime/] native: #20 pc 0005973b /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (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/] native: #21 pc 00059843 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btDbvtBroadphase::rayTest(btVector3 const&, btVector3 const&, btBroadphaseRayCallback&, btVector3 const&, btVector3 const&)+74)
F/art (10282): art/runtime/] native: #22 pc 000645d7 /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (btCollisionWorld::rayTest(btVector3 const&, btVector3 const&, btCollisionWorld::RayResultCallback&) const+78)
F/art (10282): art/runtime/] native: #23 pc 000523eb /data/app/com.renewablegames.duckyinspace-2/lib/arm/ (Java_com_jme3_bullet_PhysicsSpace_rayTest_1native+126)
F/art (10282): art/runtime/] 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/] at com.jme3.bullet.PhysicsSpace.rayTest_native(Native method)
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.rayTest(
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.rayTest(
F/art (10282): art/runtime/] at com.jme3.bullet.control.BetterCharacterControl.checkOnGround(
F/art (10282): art/runtime/] at com.jme3.bullet.control.BetterCharacterControl.prePhysicsTick(
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.preTick_native(
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.stepSimulation(Native method)
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.update(
F/art (10282): art/runtime/] at com.jme3.bullet.PhysicsSpace.update(
F/art (10282): art/runtime/] at com.jme3.bullet.BulletAppState.render(
F/art (10282): art/runtime/] at
F/art (10282): art/runtime/] at
F/art (10282): art/runtime/] at
F/art (10282): art/runtime/] at
F/art (10282): art/runtime/] at android.opengl.GLSurfaceView$GLThread.guardedRun(
F/art (10282): art/runtime/] at android.opengl.GLSurfaceView$
F/art (10282): art/runtime/]

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

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/] 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

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


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