jit thread pool crash - android

Im developing an Android application and now I am getting a very strange error I have no idea why it happens.
I also found no similar problem in the internet.
My project is also really big and so with this error message I dont really know which code could cause this, that is why here is no code.
crash log:
pid: 4228, tid: 4235, name: Jit thread pool >>> com.application.norm <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc0000000018
x0 0000000000000014 x1 0000fbd4a757e530 x2 8000000000000003 x3 0000000000000014
x4 0000fbd4a75e6448 x5 0000000000000009 x6 0000000000000000 x7 0000000000000000
x8 0000000000000127 x9 8a1336e56e6fef71 x10 0000000000000000 x11 0000000000000000
x12 0000000000000000 x13 0000fbd4abe7ac90 x14 ffffffffffffffff x15 0000000000000000
x16 000000000000019e x17 00000000000001a1 x18 0000000000000038 x19 0000fbd4a95fe960
x20 00000c0000000000 x21 0000fbd4abe86678 x22 0000000000000014 x23 0000fbd4abe77bd0
x24 0000000000000128 x25 0000fbd4a9fc0828 x26 0000000000000126 x27 0000fbd4abe77bb0
x28 0000000000000000 x29 0000fbd4a95fe880
sp 0000fbd4a95fe800 lr 0000fbd4a9ef7090 pc 0000fbd4a9ef70c0
backtrace:
#00 pc 00000000002130c0 /system/lib64/libart-compiler.so (art::RegisterAllocationResolver::ConnectSiblings(art::LiveInterval*)+608)
#01 pc 000000000016cd64 /system/lib64/libart-compiler.so (art::RegisterAllocationResolver::Resolve(art::ArrayRef<art::HInstruction* const>, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, art::ArrayRef<art::LiveInterval* const>)+884)
#02 pc 000000000021490c /system/lib64/libart-compiler.so (art::RegisterAllocatorLinearScan::AllocateRegisters()+140)
#03 pc 0000000000209d90 /system/lib64/libart-compiler.so (art::AllocateRegisters(art::HGraph*, art::CodeGenerator*, art::PassObserver*, art::RegisterAllocator::Strategy, art::OptimizingCompilerStats*)+640)
#04 pc 0000000000209558 /system/lib64/libart-compiler.so (art::OptimizingCompiler::TryCompile(art::ArenaAllocator*, art::ArenaStack*, art::CodeVectorAllocator*, art::DexCompilationUnit const&, art::ArtMethod*, bool, art::VariableSizedHandleScope*) const+2120)
#05 pc 00000000001681fc /system/lib64/libart-compiler.so (art::OptimizingCompiler::JitCompile(art::Thread*, art::jit::JitCodeCache*, art::ArtMethod*, bool, art::jit::JitLogger*)+820)
#06 pc 000000000010d60c /system/lib64/libart-compiler.so (art::jit::JitCompiler::CompileMethod(art::Thread*, art::ArtMethod*, bool)+204)
#07 pc 0000000000309fcc /system/lib64/libart.so (art::jit::Jit::CompileMethod(art::ArtMethod*, art::Thread*, bool)+620)
#08 pc 000000000030c694 /system/lib64/libart.so (art::jit::JitCompileTask::Run(art::Thread*)+644)
#09 pc 00000000004b0bb8 /system/lib64/libart.so (art::ThreadPoolWorker::Run()+88)
#10 pc 00000000004b068c /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+148)
#11 pc 0000000000083114 /system/lib64/libc.so (__pthread_start(void*)+36)
#12 pc 00000000000233bc /system/lib64/libc.so (__start_thread+68)
Every time this crash occurs, The following information will be included in the dmesg information
Line 780: [ 7.247798] EXT4-fs (mmcblk0p12): 1 orphan inode deleted
Line 781: [ 7.253968] EXT4-fs (mmcblk0p12): recovery complete
Line 782: [ 7.266940] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
Line 819: [ 7.826534] EXT4-fs (mmcblk0p12): Ignoring removed nomblk_io_submit option
I don't know if this exception message is related to this crash。
if you know, please help me,
thanks a lot

In my case (quite a large Qt-based project) this was caused by an attempt to use a dangling pointer to an instance of QObject derived class.

Related

After clicking the camera option, the flutter Android application crashes

After clicking the camera option, the flutter Android application crashes, please let me know if anyone have encountered similar problems, and what is the solution?
E/flutter (27819): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Methods marked with #UiThread must be executed on the main thread. Current thread: 1.raster
E/flutter (27819): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1405)
E/flutter (27819): at io.flutter.embedding.engine.FlutterJNI.destroyOverlaySurfaces(FlutterJNI.java:1174)
E/flutter (27819):
F/flutter (27819): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1559)] Check failed: fml::jni::CheckException(env).
F/crashpad(29173): dlopen: dlopen failed: library "libicu.so" not found: needed by /system/lib64/libharfbuzz_ng.so in namespace (default)
F/libc (27819): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 27967 (1.raster), pid 27819 (.newenergycloud)
Build fingerprint: 'HUAWEI/LIO-AL00/HWLIO:12/HUAWEILIO-AL00/103.0.0.202C00:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2023-02-15 17:25:49.743754003+0800
Process uptime: 0s
Cmdline: com.solway.newenergycloud
pid: 27819, tid: 27967, name: 1.raster >>> com.solway.newenergycloud <<<
uid: 10956
tagged_addr_ctrl: 0000000000000001
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1559)] Check failed: fml::jni::CheckException(env).
'
x0 0000000000000000 x1 0000000000006d3f x2 0000000000000006 x3 0000007ce030f5e0
x4 2e00000000000000 x5 2e00000000000000 x6 2e00000000000000 x7 00000000000000ff
x8 00000000000000f0 x9 c2b79e109d97af94 x10 0000000000000000 x11 ffffff80fffffbdf
x12 0000000000000001 x13 00000000175868d8 x14 ff00000000000000 x15 ffffffffffffffff
x16 0000007e00f61088 x17 0000007e00f3b130 x18 0000007cddcbe000 x19 0000000000006cab
x20 0000000000006d3f x21 00000000ffffffff x22 b400007c7d223c70 x23 b400007c7d223c58
x24 0000000000000071 x25 0000007ce0310000 x26 0000000000000000 x27 0000000000000001
x28 0000000000000071 x29 0000007ce030f660
lr 0000007e00eede58 sp 0000007ce030f5c0 pc 0000007e00eede84 pst 0000000000001000
backtrace:
#00 pc 0000000000089e84 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: e18cca17d252ede5b01226139ce195f2)
#01 pc 000000000150a740 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#02 pc 000000000152c79c /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#03 pc 0000000001513f74 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#04 pc 0000000001bddd98 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#05 pc 0000000001bdcaf4 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#06 pc 000000000183e464 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#07 pc 00000000018496b0 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#08 pc 000000000152d45c /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#09 pc 00000000015339c8 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#10 pc 0000000000016984 /system/lib64/libutils.so (android::Looper::pollInner(int)+912) (BuildId: 6769bcce7774e1701581578ee8903b7f)
#11 pc 000000000001658c /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: 6769bcce7774e1701581578ee8903b7f)
#12 pc 0000000000017188 /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: a6764f62e371be89b7fb40c0ab75522c)
#13 pc 0000000001533950 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#14 pc 000000000152d3a4 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#15 pc 0000000001531250 /data/app/~~X16mpvQKFjCkT6tb2AGl9g==/com.solway.newenergycloud-G9GB52tHtY7f8Q6SLnL7FA==/lib/arm64/libflutter.so (BuildId: c42c6209986a10065da91c022954abcc47cb6c46)
#16 pc 00000000000ebbb0 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: e18cca17d252ede5b01226139ce195f2)
#17 pc 000000000008b6a8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e18cca17d252ede5b01226139ce195f2)
Lost connection to device.
I have checked the required camera permissions to make sure that the permissions are enabled; then open the camera still crashed.

Unity 2019.3 : "Crash On Android Phone"

I have built AAB (for ARM & ARM-64) then test it to my Android Smartphone, but I found it crash.
By Inspecting the log I found below error (using HTC U11, API Level 26):
Build fingerprint: 'htc/ocndugl_00401/htc_ocndugl:8.0.0/OPR6.170623.013/1002308.10:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 31372, tid: 31556, name: Loading.Preload >>> com.apps.mygame <<<
signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr --------
x0 0000000000000000 x1 0000000000007b44 x2 0000000000000005 x3 0000007dad1fe1d1
x4 000000004e524157 x5 000000004e524157 x6 000000004e524157 x7 00000000004e5241
x8 0000000000000083 x9 346b4f359488495f x10 346b4f359488495f x11 0000000000000000
x12 0000000000000000 x13 0000000000000000 x14 0000000000000000 x15 0000007e351c8000
x16 0000007e3341f2e8 x17 0000007e333c0e04 x18 0000000000000000 x19 0000007dad1fead8
x20 0000000000000000 x21 0000007e14bfc840 x22 0000007e1428c11c x23 0000007dad1ff588
x24 0000007e14c36000 x25 0000000000800101 x26 000000000014d618 x27 0000007e110ef700
x28 0000007e110ef010 x29 0000000000000008 x30 0000007e1428be84
sp 0000007dad1fea60 pc 0000007e333c0e0c pstate 0000000000000000
backtrace:
#00 pc 000000000006ae0c /system/lib64/libc.so (tgkill+8)
#01 pc 000000000064ae80 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#02 pc 000000000064b390 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#03 pc 000000000027fa58 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#04 pc 000000000027fdf4 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#05 pc 00000000003035d0 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#06 pc 000000000030701c /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#07 pc 00000000002fff90 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#08 pc 0000000000329b80 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#09 pc 0000000000334628 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#10 pc 000000000032bf00 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#11 pc 000000000032c4e0 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#12 pc 0000000000276b40 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#13 pc 0000000000278488 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#14 pc 00000000002782d4 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#15 pc 0000000000278240 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#16 pc 00000000002cd5b8 /data/app/com.apps.mygame-dztW0fQOeFKAoF2N3WRWqw==/lib/arm64/libunity.so
#17 pc 00000000000677a4 /system/lib64/libc.so (_ZL15__pthread_startPv+36)
#18 pc 000000000001f2a4 /system/lib64/libc.so (__start_thread+68)
I read on Unity Forum it caused by Graphic Issue so need to disable OpenGL es 3. I have tested it but still failed.
Note, I'm using below plugin (All are latest) :
Unity IAP
Google Admob
Firebase
Also, I'm using Unity 2019.3.12f1 (almost latest)
Any Idea?

RenderThread SIGABRT

I'm receiving a native crash using a shared element transition between activities, but only for Android 8.1 and on Google devices (Pixel, Pixel 2, Nexus 6P, etc...):
pid: 20499, tid: 22683, name: RenderThread >>> [APPNAME] <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'sp<> assignment detected data race'
x0 0000000000000000 x1 000000000000589b x2 0000000000000006 x3 0000000000000008
x4 0700007411003135 x5 0700007411003135 x6 0700007411003135 x7 3531ffffffffffff
x8 0000000000000083 x9 0000000010000000 x10 0000007214bf4ca0 x11 0000000000000001
x12 0000007214bf4dc0 x13 ffffffffffffffff x14 ffffffffffff0000 x15 ffffffffffffffff
x16 0000005c0f077fa8 x17 00000072b09c752c x18 0000000000000008 x19 0000000000005013
x20 000000000000589b x21 0000000000000083 x22 00000072249f1f40 x23 00000072249f1f58
x24 0000007214717590 x25 00000072248393a0 x26 00000072118d9220 x27 0000007214bf5350
x28 0000007214bf5300 x29 0000007214bf4ce0 x30 00000072b097c760
sp 0000007214bf4ca0 pc 00000072b097c788 pstate 0000000060000000
backtrace:
#00 pc 000000000001d788 /system/lib64/libc.so (abort+120)
#01 pc 0000000000007f08 /system/lib64/liblog.so (__android_log_assert+296)
#02 pc 0000000000010af4 /system/lib64/libutils.so (android::sp_report_race()+28)
#03 pc 00000000000fdd08 /system/lib64/libandroid_runtime.so (android::RootRenderNode::detachAnimators()+320)
#04 pc 00000000000fbcac /system/lib64/libandroid_runtime.so (android::AnimationContextBridge::destroy()+24)
#05 pc 000000000006fbd0 /system/lib64/libhwui.so (android::uirenderer::renderthread::Bridge_destroy(android::uirenderer::renderthread::destroyArgs*)+12)
#06 pc 00000000000718fc /system/lib64/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+24)
#07 pc 0000000000071c70 /system/lib64/libhwui.so (android::uirenderer::renderthread::SignalingRenderTask::run()+28)
#08 pc 0000000000072a58 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+336)
#09 pc 0000000000011478 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
#10 pc 00000000000a9814 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
#11 pc 0000000000067d80 /system/lib64/libc.so (__pthread_start(void*)+36)
#12 pc 000000000001ec18 /system/lib64/libc.so (__start_thread+68)
It crashes also if the app is on background. How can I solve this? It seems to happen only if the Hardware Acceleration is enable, but I really need it enabled on my app.
I was having same issue with an AnimatedVectorDrawable set as a background of an ImageView. So basically i was showing the same animation in different rows of a recyclerview but using same object of AnimatedVectorDrawable, which lead to this crash. I solved it by creating separate objects for separate ViewHolders.
Saw the same native stack sometimes when (inadvertently) trying to restart an animation loop for an AnimatedVectorDrawable after (or perhaps while) trying to pause an Activity.
For reference, the animation loop was this:
((Animatable2)animatable).registerAnimationCallback(new Animatable2.AnimationCallback() {
#Override
public void onAnimationEnd(Drawable drawable) {
animatable.start();
}
});
When toggling away from the app, this was logged:
W/WindowManager: Unable to start animation, surface is null or no children.
Followed by a similar native stack for a race condition:
A/DEBUG: backtrace:
A/DEBUG: #00 pc 0000000000021abc /system/lib64/libc.so (abort+124)
A/DEBUG: #01 pc 00000000000080f8 /system/lib64/liblog.so (__android_log_assert+296)
A/DEBUG: #02 pc 000000000000f26c /system/lib64/libutils.so (android::sp_report_race()+28)
A/DEBUG: #03 pc 000000000010d698 /system/lib64/libandroid_runtime.so (android::RootRenderNode::detachAnimators()+320)
A/DEBUG: #04 pc 000000000010b768 /system/lib64/libandroid_runtime.so (android::AnimationContextBridge::destroy()+24)
A/DEBUG: #05 pc 00000000005d211c /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::destroy()+124)
A/DEBUG: #06 pc 00000000005d5550 /system/lib64/libhwui.so (std::__1::packaged_task<void ()>::operator()()+88)
A/DEBUG: #07 pc 00000000005870b0 /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+168)
A/DEBUG: #08 pc 00000000001fd60c /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+244)
A/DEBUG: #09 pc 000000000000fb80 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
A/DEBUG: #10 pc 0000000000083114 /system/lib64/libc.so (__pthread_start(void*)+36)
A/DEBUG: #11 pc 00000000000233bc /system/lib64/libc.so (__start_thread+68)
This has stopped the problem - it should have been there all along in the Activity class:
#Override
protected void onPause() {
super.onPause();
animatable.stop();
}

SIGSEGV when using native library on android, hardware accelerated only

I'm using the Superpowered SDK to do some audio playback and recording. When I press a button to start playback the app crashes with
A/DEBUG: ABI: 'arm64'
A/DEBUG: pid: 18529, tid: 18548, name: RenderThread >>> com.superpowered.example <<<
A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
A/DEBUG: x0 0000007f789f8000 x1 0000007f7409f288 x2 0000007f7d6a8a88 x3 0000000000fe502b
A/DEBUG: x4 0000000000116906 x5 0000000000000000 x6 00000a4cc0b1813f x7 0000007f789f8000
A/DEBUG: x8 000000000055655a x9 000000000055655a x10 000000000000a8c0 x11 00000000213b09a0
A/DEBUG: x12 0000000000000018 x13 ffffffffa82de1ea x14 000bb95f86000000 x15 003b9aca00000000
A/DEBUG: x16 0000007f7dadc7d8 x17 0000007f7d6a8a54 x18 0000007f78892ee8 x19 0000007f78891000
A/DEBUG: x20 0000007f7409f288 x21 0000007f78892ee8 x22 0000007f7bf4e000 x23 0000007f7bf4e000
A/DEBUG: x24 0000007f7409f288 x25 7fffffffffffffff x26 00000000ffffffff x27 0000007f7a52a9b0
A/DEBUG: x28 0000007f635331e0 x29 0000007f7409f190 x30 0000007f7bec3840
A/DEBUG: sp 0000007f7409f190 pc 0000007f7bec3850 pstate 0000000080000000
A/DEBUG: backtrace:
A/DEBUG: #00 pc 0000000000025850 /system/lib64/libhwui.so
A/DEBUG: #01 pc 0000000000026e5c /system/lib64/libhwui.so
A/DEBUG: #02 pc 0000000000026fd8 /system/lib64/libhwui.so
A/DEBUG: #03 pc 000000000002b43c /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+124)
A/DEBUG: #04 pc 000000000001579c /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+208)
A/DEBUG: #05 pc 00000000000903cc /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+96)
A/DEBUG: #06 pc 0000000000014fec /system/lib64/libutils.so
A/DEBUG: #07 pc 0000000000065fb4 /system/lib64/libc.so (__pthread_start(void*)+52)
A/DEBUG: #08 pc 000000000001ed84 /system/lib64/libc.so (__start_thread+16)
I already opened an issue on their github repo, but they won't investigate any further bacause it's obviously an error in my "custom UI code".
So after hours of debugging here is what I found:
It seems like triggering playback in the native library somehow interferes with the android internals.
Adding random delays to the button actions reduces the likelihood of a crash.
A temporary workaround was to disable hardware acceleration (android:hardwareAccelerated="false").
If you want to try it yourself you can find the code here.
Has anyone had a similiar problem? Is there any workaround that doesn't involve disabling HW acceleration? Any help is greatly appreciated!

JNI ERROR (app bug): local reference table overflow (max=512) even with out Native Code

we recently launched our app and upgrade actually from previous version..
and suddenly we started to see this error in a ton of devices ..we have no clue whats happening and the logs are very vague ..
Attaching the logs here .But any help or some clue might help us debug the issue .
Build fingerprint: 'Verizon/zeroltevzw/zeroltevzw:5.1.1/LMY47X/G925VVRU4BOK7:user/release-keys'
Revision: '10'
ABI: 'arm64'
pid: 31610, tid: 31610, name: st.mediamanager >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'sart/runtime/indirect_reference_table.cc:98] JNI ERROR (app bug): local reference table overflow (max=512)'
x0 0000000000000000 x1 0000000000007b7a x2 0000000000000006 x3 0000007fa219fe30
x4 0000007fa219fe30 x5 0000000000000005 x6 0000000000000001 x7 0000000000000020
x8 0000000000000083 x9 00000000000000ca x10 0000007fa1f2a000 x11 0000000000000001
x12 0000000000000001 x13 0000007fa1f2a000 x14 c4aa4c0daad90e20 x15 0000007f92002a31
x16 0000007fa1f2a610 x17 0000007fa1eca174 x18 0000000000000000 x19 0000007fa219fe30
x20 0000007fa21a00e8 x21 0000007fa1f30000 x22 0000000000000001 x23 0000000000000006
x24 0000007fee90e2d0 x25 0000007f9e0a6000 x26 0000007fee90e2c8 x27 0000007f9dffd520
x28 0000007f9e0a6000 x29 0000007fee90e150 x30 0000007fa1e8c264
sp 0000007fee90e150 pc 0000007fa1eca17c pstate 0000000060000000
backtrace:
#00 pc 000000000005e17c /system/lib64/libc.so (tgkill+8)
#01 pc 0000000000020260 /system/lib64/libc.so (pthread_kill+160)
#02 pc 0000000000021794 /system/lib64/libc.so (raise+28)
#03 pc 000000000001b17c /system/lib64/libc.so (abort+60)
#04 pc 0000000000310534 /system/lib64/libart.so (art::Runtime::Abort()+300)
#05 pc 00000000000d5378 /system/lib64/libart.so (art::LogMessage::~LogMessage()+2684)
#06 pc 00000000001e7ff0 /system/lib64/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+416)
#07 pc 00000000002e28cc /system/lib64/libart.so (art::VMClassLoader_findLoadedClass(_JNIEnv*, _jclass*, _jobject*, _jstring*)+248)
#08 pc 000000000002a5dc /system/framework/arm64/boot.oat
Build fingerprint: 'Verizon/trltevzw/trltevzw:5.1.1/LMY47X/N910VVRU2BPA1:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 481, tid: 481, name: st.mediamanager >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'sart/runtime/indirect_reference_table.cc:109] JNI ERROR (app bug): local reference table overflow (max=512)'
r0 00000000 r1 000001e1 r2 00000006 r3 00000000
r4 b6fc3e38 r5 00000006 r6 00000016 r7 0000010c
r8 00000000 r9 b486f550 sl b4827800 fp 00000475
ip 000001e1 sp bebbaaf8 lr b6e22715 pc b6e46854 cpsr 60070010
backtrace:
#00 pc 00038854 /system/lib/libc.so (tgkill+12)
#01 pc 00014711 /system/lib/libc.so (pthread_kill+52)
#02 pc 0001532f /system/lib/libc.so (raise+10)
#03 pc 00011bc9 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0001003c /system/lib/libc.so (abort+4)
#05 pc 00230cd1 /system/lib/libart.so (art::Runtime::Abort()+160)
#06 pc 000ac58b /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
#07 pc 0016996d /system/lib/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+244)
#08 pc 00214f43 /system/lib/libart.so (art::VMClassLoader_findLoadedClass(_JNIEnv*, _jclass*, _jobject*, _jstring*)+162)
#09 pc 0001bd8d /system/framework/arm/boot.oat
Build fingerprint: 'Verizon/zenltevzw/zenltevzw:5.1.1/LMY47X/G928VVRU2AOJ3:user/release-keys'
Revision: '9'
ABI: 'arm64'
pid: 18658, tid: 18658, name: st.mediamanager >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'sart/runtime/indirect_reference_table.cc:109] JNI ERROR (app bug): local reference table overflow (max=512)'
x0 0000000000000000 x1 00000000000048e2 x2 0000000000000006 x3 0000007fa3887e30
x4 0000007fa3887e30 x5 0000000000000005 x6 0000000000000001 x7 0000000000000020
x8 0000000000000083 x9 000000000000005e x10 0000007fa3613000 x11 0000000000000001
x12 0000000000000001 x13 0000007fa3613000 x14 24d3f27831b256ef x15 0000000000000001
x16 0000007fa3613610 x17 0000007fa35b30d4 x18 0000000000000000 x19 0000007fa3887e30
x20 0000007fa38880e8 x21 0000007fa3619000 x22 0000000000000001 x23 0000000000000006
x24 0000007fc7e2cbc0 x25 0000007f9f820d40 x26 0000000000000001 x27 0000007f8c101b60
x28 0000000000000000 x29 0000007fc7e2ca40 x30 0000007fa3575224
sp 0000007fc7e2ca40 pc 0000007fa35b30dc pstate 0000000060000000
backtrace:
#00 pc 000000000005e0dc /system/lib64/libc.so (tgkill+8)
#01 pc 0000000000020220 /system/lib64/libc.so (pthread_kill+160)
#02 pc 0000000000021754 /system/lib64/libc.so (raise+28)
#03 pc 000000000001b13c /system/lib64/libc.so (abort+60)
#04 pc 00000000002ffca4 /system/lib64/libart.so (art::Runtime::Abort()+300)
#05 pc 00000000000d15b8 /system/lib64/libart.so (art::LogMessage::~LogMessage()+2684)
#06 pc 00000000002ad730 /system/lib64/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+952
#07 pc 0000000000314978 /system/lib64/libart.so (art::StackDumpVisitor::VisitFrame()+568)
#08 pc 000000000030ba08 /system/lib64/libart.so (art::StackVisitor::WalkStack(bool)+308)
#09 pc 0000000000313754 /system/lib64/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+268)
#10 pc 0000000000313968 /system/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+272)
#11 pc 000000000031e8dc /system/lib64/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+100)
#12 pc 00000000002ffd34 /system/lib64/libart.so (art::Runtime::Abort()+444)
#13 pc 00000000000d15b8 /system/lib64/libart.so (art::LogMessage::~LogMessage()+2684)
#14 pc 00000000001d7468 /system/lib64/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+416)
#15 pc 00000000002d2018 /system/lib64/libart.so (art::VMClassLoader_findLoadedClass(_JNIEnv*, _jclass*, _jobject*, _jstring*)+248)
#16 pc 000000000002a5dc /system/framework/arm64/boot.oat
Build fingerprint: 'Verizon/kltevzw/kltevzw:5.0/LRX21T/G900VVRU2BOK3:user/release-keys'
Revision: '14'
ABI: 'arm'
pid: 32148, tid: 32148, name: st.mediamanager >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'art/runtime/indirect_reference_table.cc:113] JNI ERROR (app bug): local reference table overflow (max=512)'
r0 00000000 r1 00007d94 r2 00000006 r3 00000000
r4 b6f92114 r5 00000006 r6 00000016 r7 0000010c
r8 00000000 r9 b4e4f520 sl b4e07800 fp 000004ba
ip 00007d94 sp be8a3b38 lr b6f1bfd1 pc b6f40268 cpsr 60070010
backtrace:
#00 pc 00038268 /system/lib/libc.so (tgkill+12)
#01 pc 00013fcd /system/lib/libc.so (pthread_kill+52)
#02 pc 00014beb /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 0021d5d9 /system/lib/libart.so (art::Runtime::Abort()+160)
#06 pc 000a834b /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
#07 pc 001574b7 /system/lib/libart.so (art::IndirectReferenceTable::Add(unsigned int, art::mirror::Object*)+346)
#08 pc 002010d5 /system/lib/libart.so (art::VMClassLoader_findLoadedClass(_JNIEnv*, _jclass*, _jobject*, _jstring*)+136)
#09 pc 0001b151 /system/framework/arm/boot.oat
I don't have a full answer, but its too lengthy for a comment so I'll post it as one.
So the error is just what you expect- its a call into native code that causes you to have more than 512 objects shared with native. Usually that happens because of a leak somewhere. And you don't need to be using native code directly to do it- the framework makes a LOT of native calls behind the scenes.
From the stack trace- I see its libart.so, not libdalvik.so. So this is happening on new devices which have switched from the Dalvik VM to Art. The stack trace looks like it was trying to load a class and add a reference to it for some JNI code, but I can't be certain of that. I do know that we've seen class loading bugs at work on Art that didn't exist on dalvik.
If you have any native code at all I'd make sure you were releasing all reference to java memory and classes properly. If you don't- this may be a bug in Art, knowing what the app was doing at the time of the crash would be useful. Is the crash consistent? If so, what are you doing?

Categories

Resources