I am new to android development. I developed an android application which was working perfectly fine before enabling R8. After obfuscating the application, I am getting the following error. I have no idea where am I going wrong.
Following is the Logcat console:
2020-01-28 16:16:09.404 5206-5206/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: Build fingerprint: 'samsung/j6ltecis/j6lte:9/PPR1.180610.011/J600FXXU5BSH5:user/release-keys'
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: Revision: '2'
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: ABI: 'arm'
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: pid: 5073, tid: 5073, name: e.peopleconnect >>> pk.com.ke.peopleconnect <<<
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: Abort message: 'interpreter_common.h:269] Check failed: receiver->GetClass()->ShouldHaveEmbeddedVTable() '
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: r0 00000000 r1 000013d1 r2 00000006 r3 00000008
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: r4 000013d1 r5 000013d1 r6 fff98dac r7 0000010c
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: r8 0000000b r9 efecd000 r10 d4dfe09c r11 fff98ed0
2020-01-28 16:16:09.405 5206-5206/? A/DEBUG: ip 00000041 sp fff98d98 lr f3233115 pc f3229fce
2020-01-28 16:16:09.441 3242-3316/? D/SensorService: [SO] -1.307 4.961 9.835
2020-01-28 16:16:09.441 3242-3316/? D/SensorService: [SO] [0 -> 255]
2020-01-28 16:16:09.469 2818-26162/? V/APM_AudioPolicyManager: getAudioPolicyConfig: audioParam;outDevice
2020-01-28 16:16:09.470 2818-26162/? V/APM_AudioPolicyManager: getNewOutputDevice() selected device 0
2020-01-28 16:16:09.470 2818-26162/? V/APM_AudioPolicyManager: ### curdevice : 2
2020-01-28 16:16:09.592 3242-3384/? D/WifiTrafficPoller: TrafficStats TxPkts=394436 RxPkts=647369 TxBytes=46490190 RxBytes=822657331 , Foreground uid=10240 pkgName=pk.com.ke.peopleconnect TxPackets=84 RxPackets=73 TxBytes=12001 RxBytes=49973
2020-01-28 16:16:09.604 5206-5206/? A/DEBUG: backtrace:
2020-01-28 16:16:09.604 5206-5206/? A/DEBUG: #00 pc 0001cfce /system/lib/libc.so (abort+58)
2020-01-28 16:16:09.604 5206-5206/? A/DEBUG: #01 pc 0035e2ff /system/lib/libart.so (art::Runtime::Abort(char const*)+1034)
2020-01-28 16:16:09.604 5206-5206/? A/DEBUG: #02 pc 000071c3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+506)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #03 pc 003f68fd /system/lib/libart.so (MterpInvokeVirtualQuick+548)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #04 pc 00417814 /system/lib/libart.so (ExecuteMterpImpl+29972)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #05 pc 001f309c /data/app/pk.com.ke.peopleconnect-3XBY7V7mKYeci83RcRrdaA==/oat/arm/base.vdex (pk.com.ke.peopleconnect.activities.K.a+116)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #06 pc 001cc457 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2255586636+354)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #07 pc 001d0d8f /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #08 pc 001e7b3f /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+762)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #09 pc 003f688b /system/lib/libart.so (MterpInvokeVirtualQuick+434)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #10 pc 00417814 /system/lib/libart.so (ExecuteMterpImpl+29972)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #11 pc 001f3010 /data/app/pk.com.ke.peopleconnect-3XBY7V7mKYeci83RcRrdaA==/oat/arm/base.vdex (pk.com.ke.peopleconnect.activities.K.success+4)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #12 pc 001cc457 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2255586636+354)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #13 pc 001d0d8f /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #14 pc 001e7b3f /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+762)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #15 pc 003f5001 /system/lib/libart.so (MterpInvokeInterface+1024)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #16 pc 00413c94 /system/lib/libart.so (ExecuteMterpImpl+14740)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #17 pc 001fcdd8 /data/app/pk.com.ke.peopleconnect-3XBY7V7mKYeci83RcRrdaA==/oat/arm/base.vdex (retrofit.CallbackRunnable$1.run+28)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #18 pc 001cc457 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2255586636+354)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #19 pc 001d0cdb /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #20 pc 003e7ccb /system/lib/libart.so (artQuickToInterpreterBridge+882)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #21 pc 004252ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #22 pc 00987251 /system/framework/arm/boot-framework.oat (offset 0x3fd000) (android.os.Handler.dispatchMessage+64)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #23 pc 009899a3 /system/framework/arm/boot-framework.oat (offset 0x3fd000) (android.os.Looper.loop+1162)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #24 pc 007e30bb /system/framework/arm/boot-framework.oat (offset 0x3fd000) (android.app.ActivityThread.main+690)
2020-01-28 16:16:09.605 5206-5206/? A/DEBUG: #25 pc 00420d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #26 pc 003f988b /system/lib/libart.so (art_quick_invoke_static_stub+222)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #27 pc 000a181f /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #28 pc 00358161 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #29 pc 003595b3 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+962)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #30 pc 003080f5 /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+40)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #31 pc 0011328f /system/framework/arm/boot.oat (offset 0x10d000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #32 pc 00bdcc4b /system/framework/arm/boot-framework.oat (offset 0x3fd000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+114)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #33 pc 00be2445 /system/framework/arm/boot-framework.oat (offset 0x3fd000) (com.android.internal.os.ZygoteInit.main+1916)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #34 pc 00420d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #35 pc 003f988b /system/lib/libart.so (art_quick_invoke_static_stub+222)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #36 pc 000a181f /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #37 pc 00358161 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #38 pc 00357f75 /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+300)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #39 pc 00299321 /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+476)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #40 pc 000712ff /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+38)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #41 pc 000737ab /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+478)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #42 pc 00002f15 /system/bin/app_process32 (main+728)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #43 pc 0008de5d /system/lib/libc.so (__libc_init+48)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #44 pc 00002bfd /system/bin/app_process32 (_start_main+40)
2020-01-28 16:16:09.606 5206-5206/? A/DEBUG: #45 pc 00000306 <anonymous:f45d9000>
Following are default settings and dependencies used.
buildTypes {
release {
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
dependencies {
}
The issue was resolved on the R8 bug tracker, issue 148521210.
Related
I'm trying to get the Sony Stock Camera from their tama devices working on Android 12.
I'm getting the following backtrace:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Sony/H8324/H8324:10/52.1.A.3.49/052001A003004902006556692:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-08-16 20:04:11.168778323+0200
Process uptime: 0s
Cmdline: com.sonyericsson.android.camera
pid: 3646, tid: 3678, name: ImageReader >>> com.sonyericsson.android.camera <<<
uid: 10133
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000007c7081b5d0 x1 0000007ee0a7f7cc x2 0000000000000000 x3 0000000000000010
x4 0000000000000000 x5 0000007bce6a9fa8 x6 0000007f020ff000 x7 0000000000001ac8
x8 0000007eebfefa38 x9 0000007eebfb6d00 x10 0000007eebfefa28 x11 000000007081b5e8
x12 0000ffff00000eff x13 00000000db4450c6 x14 003b7c4575e22800 x15 0000e787a5a92f54
x16 0000007ef28a97f8 x17 0000007ee09e4c78 x18 0000007bce16e000 x19 ffffffff9d042408
x20 0000007da07ef240 x21 00000000ce6aa260 x22 0000000000000000 x23 0000007bce6ab000
x24 0000007c4d808d00 x25 0000007bce6aa470 x26 0000007bce6aa484 x27 0000007bce6aa470
x28 0000007bce6aa360 x29 0000007bce6aa210
lr 0000007eebfac2b8 sp 0000007bce6aa200 pc 0000007eebfac2dc pst 0000000060000000
backtrace:
#00 pc 00000000000e22dc /system/lib64/libgui.so (android::Surface::Surface(android::sp<android::IGraphicBufferProducer> const&, bool, android::sp<android::IBinder> const&)+128) (BuildId: 5f0e35ac67a320ebbf7dbfedaba3b4f3)
#01 pc 000000000000103c /system/system_ext/lib64/libgui_shim.so (android::Surface::Surface(android::sp<android::IGraphicBufferProducer> const&, bool)+40) (BuildId: f763096071886df8dfce73855c765827)
#02 pc 0000000000011eb4 /system/lib64/libimageprocessorjni.so (BypassCameraBurstBufferManager_initializeSurface+216) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7)
#03 pc 000000000000e8c4 /system/lib64/libimageprocessorjni.so (BypassCameraPhoto_prepareSnapshot+84) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7)
#04 pc 000000000000c580 /system/lib64/libimageprocessorjni.so (Java_com_sonymobile_imageprocessor_bypasscamera2_BypassCamera_nativeRequestPrepareSnapshot+24) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7)
#05 pc 0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#06 pc 0000000000212b80 /apex/com.android.art/lib64/libart.so (nterp_helper+5648) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#07 pc 000000000068c7bc /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk (com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.requestPrepareSnapshot+4)
#08 pc 00000000002124c4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#09 pc 00000000005c3c84 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk (com.sonyericsson.android.camera.device.BypassCameraController.requestPrepareSnapshot+184)
#10 pc 00000000002124c4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#11 pc 00000000005c2b28 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk (com.sonyericsson.android.camera.device.BypassCameraController.access$5400+0)
#12 pc 00000000002115a4 /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#13 pc 00000000005c0652 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk (com.sonyericsson.android.camera.device.BypassCameraController$1.run+474)
#14 pc 0000000000519190 /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+80) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085)
#15 pc 000000000051c08c /system/framework/arm64/boot-framework.oat (android.os.Looper.loopOnce+1148) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085)
#16 pc 000000000051bb74 /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+516) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085)
#17 pc 000000000051b058 /system/framework/arm64/boot-framework.oat (android.os.HandlerThread.run+536) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085)
#18 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#19 pc 0000000000284208 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+188) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#20 pc 000000000061fab0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#21 pc 000000000066e674 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1184) (BuildId: 143d4d521718f1d1b0005e86eb8ae170)
#22 pc 00000000000b1810 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb)
#23 pc 00000000000512f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb)
Since libimageprocessorjni.so is closed source and there's no updated lib which matches the new Surface constructor I had to create a shim:
#include <cutils/log.h>
#include <gui/IGraphicBufferProducer.h>
#define LOG_TAG "libgui_shim"
extern "C" void _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE(
const android::sp<android::IGraphicBufferProducer>& bufferProducer, bool controlledByApp = false,
const android::sp<android::IBinder>& surfaceControlHandle = nullptr);
extern "C" void _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEb(
const android::sp<android::IGraphicBufferProducer>& bufferProducer, bool controlledByApp) {
if (bufferProducer == nullptr) {
ALOGE("bufferProducer == nullptr");
}
_ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE(bufferProducer, controlledByApp);
}
As you can see I've already tried to figure out where the null pointer happens exactly (It isn't bufferProducer because there's no bufferProducer == nullptr in the log).
I don't think it's the surfaceControlHandle but the method definition in my shim exactly matches the one from libgui: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-12.1.0_r22/libs/gui/include/gui/Surface.h#93
Running addr2line is not that helpful either:
$ aarch64-linux-android-addr2line -e libgui.so -s -f -C 00000000000e22dc
aarch64-linux-android-addr2line: libgui.so: don't know how to handle section `.relr.dyn' [0x 13]
sp
StrongPointer.h:273
Checking StrongPointer.h at line 273 (https://android.googlesource.com/platform/system/core/+/refs/tags/android-12.1.0_r22/libutils/include/utils/StrongPointer.h#273) I can see that other must be NULL.
Is there any convenient way to find out what other is and how to solve my null pointer dereference?
EDIT: The partial output from stack by reading in the tombstone as described here:
Stack Trace:
RELADDR FUNCTION FILE:LINE
v--------------> android::sp<android::IGraphicBufferProducer>::sp(android::sp<android::IGraphicBufferProducer> const&) system/core/libutils/include/utils/StrongPointer.h:273
00000000000e22dc android::Surface::Surface(android::sp<android::IGraphicBufferProducer> const&, bool, android::sp<android::IBinder> const&)+128 frameworks/native/libs/gui/Surface.cpp:67
000000000000103c android::Surface::Surface(android::sp<android::IGraphicBufferProducer> const&, bool)+40 device/sony/tama-common/libshims/gui_shim.cpp:10 (discriminator 2)
0000000000011eb4 BypassCameraBurstBufferManager_initializeSurface+216) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7 /system/lib64/libimageprocessorjni.so
000000000000e8c4 BypassCameraPhoto_prepareSnapshot+84) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7 /system/lib64/libimageprocessorjni.so
000000000000c580 Java_com_sonymobile_imageprocessor_bypasscamera2_BypassCamera_nativeRequestPrepareSnapshot+24) (BuildId: c3128a7b0c9351c6fe96247d3e3c35b7 /system/lib64/libimageprocessorjni.so
0000000000222244 art_quick_generic_jni_trampoline+148) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
0000000000212b80 nterp_helper+5648) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
000000000068c7bc com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.requestPrepareSnapshot+4 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk
00000000002124c4 nterp_helper+3924) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
00000000005c3c84 com.sonyericsson.android.camera.device.BypassCameraController.requestPrepareSnapshot+184 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk
00000000002124c4 nterp_helper+3924) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
00000000005c2b28 com.sonyericsson.android.camera.device.BypassCameraController.access$5400+0 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk
00000000002115a4 nterp_helper+52) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
00000000005c0652 com.sonyericsson.android.camera.device.BypassCameraController$1.run+474 /system/priv-app/SemcCameraUI-xxhdpi-release/SemcCameraUI-xxhdpi-release.apk
0000000000519190 android.os.Handler.dispatchMessage+80) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085 /system/framework/arm64/boot-framework.oat
000000000051c08c android.os.Looper.loopOnce+1148) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085 /system/framework/arm64/boot-framework.oat
000000000051bb74 android.os.Looper.loop+516) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085 /system/framework/arm64/boot-framework.oat
000000000051b058 android.os.HandlerThread.run+536) (BuildId: 37e0b9b91b95ea25a00d76a0661686229fcf1085 /system/framework/arm64/boot-framework.oat
0000000000218964 art_quick_invoke_stub+548) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
0000000000284208 art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+188) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
000000000061fab0 art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
000000000066e674 art::Thread::CreateCallback(void*)+1184) (BuildId: 143d4d521718f1d1b0005e86eb8ae170 /apex/com.android.art/lib64/libart.so
00000000000b1810 __pthread_start(void*)+264) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb /apex/com.android.runtime/lib64/bionic/libc.so
00000000000512f0 __start_thread+64) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb
So this must be the bufferPRoducer somehow. If i use patchelf to replace libgui with the stock version from Android 10 and a bunch of related other libs the error is gone. It must be somehow possible to use shims to get the old behavior back instead of pushing 25 old stock libs on my device.
I tried to do some periodic action in Android R automotive device by ScheduledThreadPoolExecutor.
There is my code:
private static class NamedThreadFactory implements ThreadFactory {
private final AtomicInteger mThreadNumber = new AtomicInteger(1);
private final String mNamePrefix;
NamedThreadFactory(String namePrefix) {
mNamePrefix = namePrefix + "-thread-";
}
#Override
public Thread newThread(Runnable r) {
final Thread thread = new Thread(r, mNamePrefix + mThreadNumber.getAndIncrement());
return thread;
}
}
private ScheduledThreadPoolExecutor mPopDataRefreshExecutor =
new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("refreshPopData"));
mPopDataRefreshExecutor.scheduleAtFixedRate(new PopDataRefresher(),
TimeUnit.MINUTES.toMillis(5),
TimeUnit.MINUTES.toMillis(10),
TimeUnit.MILLISECONDS);
And then, it once raise some native signal 6 exception:
Revision: '0'
ABI: 'arm'
Timestamp: 1912-01-03 13:32:13+0800
pid: 9441, tid: 11146, name: RefreshPopData- >>> com.demo <<<
uid: 1010065
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'Failed to park: Invalid argument'
r0 00000000 r1 00002b8a r2 00000006 r3 bb98eb00
r4 bb98eb14 r5 bb98eaf8 r6 000024e1 r7 0000016b
r8 bb98eb10 r9 bb98eb00 r10 bb98eb30 r11 bb98eb20
ip 00002b8a sp bb98ead0 lr f1fa158f pc f1fa15a2
backtrace:
#00 pc 000545a2 /apex/com.android.runtime/lib/bionic/libc.so (abort+166) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
#01 pc 003a0f7d /apex/com.android.runtime/lib/libart.so (art::Runtime::Abort(char const*)+1980) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#02 pc 000085e1 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+488) (BuildId: d8f9959168f480e25050a2b6cf313736)
#03 pc 003cff97 /apex/com.android.runtime/lib/libart.so (art::Thread::Park(bool, long long)+1570) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#04 pc 003417e9 /apex/com.android.runtime/lib/libart.so (art::Unsafe_park(_JNIEnv*, _jobject*, unsigned char, long long)+440) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#05 pc 000edfc9 /system/framework/arm/boot.oat (art_jni_trampoline+96) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#06 pc 0024e283 /system/framework/arm/boot.oat (java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos+818) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#07 pc 003914f7 /system/framework/arm/boot.oat (java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take+326) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#08 pc 003600dd /system/framework/arm/boot.oat (sun.nio.fs.UnixPath.getParent [DEDUPED]+36) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#09 pc 0034b265 /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor.getTask+428) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#10 pc 0034c9ff /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+222) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#11 pc 0034a0a7 /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+54) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#12 pc 001da039 /system/framework/arm/boot.oat (java.lang.Thread.run+64) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#13 pc 000e4bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#14 pc 0045e97b /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#15 pc 000ecffd /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#16 pc 0039ab77 /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#17 pc 0039b881 /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+300) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#18 pc 003d0e73 /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+982) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#19 pc 0009c5e7 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
#20 pc 00055a97 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
When I tried to add some log to solve this problem, it never happends again with same apk and same device.
Is any advice to deal with it, I tried to read AOSP code(https://cs.android.com/android/platform/superproject/+/master:art/runtime/thread.cc;l=311?q=Thread::park) and find out this stack mean to futex something failed. But I have no idea what "Failed to park: Invalid argument" means.
I am using webview and glide to display an image.
always running in the foreground
The app closes after a certain period of time with the message below
I added firebase crashlytics but firebase crashlytics does not catch the error
and i didn't find where the error is coming from
You can guess from the log below
2022-03-17 04:06:25.493 4679-4679/? A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 4679 (com.sinwho.app), pid 4679 (com.sinwho.app)
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: Build fingerprint: 'ODROID/odroidn2/odroidn2:9/PPR1.180610.011/20220314:eng/test-keys'
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: Revision: '0'
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: ABI: 'arm'
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: pid: 4679, tid: 4679, name: com.sinwho.app >>> com.sinwho.app <<<
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: Abort message: 'ubsan: add-overflow'
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: r0 00000000 r1 00001247 r2 00000006 r3 eed26918
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: r4 00001247 r5 00001247 r6 ff9a0d3c r7 0000010c
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: r8 ff9a0e20 r9 00000004 r10 00000000 r11 00000000
2022-03-17 04:06:25.570 16951-16951/? A/DEBUG: ip 00000041 sp ff9a0d28 lr eecb50e5 pc eecace72
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: backtrace:
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #00 pc 0001ce72 /system/lib/libc.so (abort+62)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #01 pc 00016bc4 /system/lib/libminikin.so (abort_with_message(char const*)+24)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #02 pc 00016c20 /system/lib/libminikin.so (__ubsan_handle_add_overflow_minimal_abort+24)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #03 pc 0000f2ef /system/lib/libminikin.so (void minikin::LayoutCache::getOrCreate<minikin::LayoutAppendFunctor>(minikin::U16StringPiece const&, minikin::Range const&, minikin::MinikinPaint const&, bool, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutAppendFunctor&)+542)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #04 pc 0000edf1 /system/lib/libminikin.so (minikin::Layout::doLayoutWord(unsigned short const*, unsigned int, unsigned int, unsigned int, bool, minikin::MinikinPaint const&, unsigned int, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutPieces const*, minikin::Layout*, float*, minikin::MinikinExtent*, minikin::MinikinRect*, minikin::LayoutPieces*)+204)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #05 pc 0000e999 /system/lib/libminikin.so (minikin::Layout::doLayoutRunCached(minikin::U16StringPiece const&, minikin::Range const&, bool, minikin::MinikinPaint const&, unsigned int, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutPieces const*, minikin::Layout*, float*, minikin::MinikinExtent*, minikin::MinikinRect*, minikin::LayoutPieces*)+244)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #06 pc 0000e86b /system/lib/libminikin.so (minikin::Layout::doLayout(minikin::U16StringPiece const&, minikin::Range const&, minikin::Bidi, minikin::MinikinPaint const&, minikin::StartHyphenEdit, minikin::EndHyphenEdit)+210)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #07 pc 00088ef1 /system/lib/libhwui.so (android::MinikinUtils::doLayout(android::Paint const*, minikin::Bidi, android::Typeface const*, unsigned short const*, unsigned int, unsigned int, unsigned int, minikin::MeasuredText*)+148)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #08 pc 003718ad /system/lib/libhwui.so (android::Canvas::drawText(unsigned short const*, int, int, int, float, float, minikin::Bidi, android::Paint const&, android::Typeface const*, minikin::MeasuredText*)+76)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #09 pc 000c9035 /system/lib/libandroid_runtime.so (android::CanvasJNI::drawTextString(_JNIEnv*, _jobject*, long long, _jstring*, int, int, float, float, int, long long)+86)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #10 pc 003d0ddb /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.RecordingCanvas.nDrawText [DEDUPED]+194)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #11 pc 0001e631 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.RecordingCanvas.drawText+120)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #12 pc 00007d43 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.text.BoringLayout.draw+106)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #13 pc 0001b92b /dev/ashmem/dalvik-jit-code-cache (deleted) (android.widget.TextView.onDraw+2962)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #14 pc 00019529 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.draw+232)
2022-03-17 04:06:26.018 16951-16951/? A/DEBUG: #15 pc 000134e3 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+690)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #16 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #17 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #18 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #19 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #20 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #21 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #22 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #23 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #24 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #25 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #26 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #27 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #28 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #29 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #30 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #31 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #32 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #33 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #34 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #35 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #36 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #37 pc 00014177 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.recreateChildDisplayList+70)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #38 pc 000142a9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewGroup.dispatchGetDisplayList+144)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #39 pc 00013319 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.View.updateDisplayListIfDirty+232)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #40 pc 0001ca77 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ThreadedRenderer.updateViewTreeDisplayList+86)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #41 pc 000183f9 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ThreadedRenderer.updateRootDisplayList+80)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #42 pc 0001a81f /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ThreadedRenderer.draw+110)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #43 pc 0001c435 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewRootImpl.draw+1636)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #44 pc 0001d1a5 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewRootImpl.performDraw+340)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #45 pc 000226d3 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewRootImpl.performTraversals+10674)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #46 pc 00009a4f /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewRootImpl.doTraversal+150)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #47 pc 0000b961 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.ViewRootImpl$TraversalRunnable.run+48)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #48 pc 00016f1b /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.Choreographer$CallbackRecord.run+186)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #49 pc 00014791 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.Choreographer.doCallbacks+496)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #50 pc 00015487 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.Choreographer.doFrame+934)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #51 pc 00025005 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.view.Choreographer$FrameDisplayEventReceiver.run+68)
2022-03-17 04:06:26.019 16951-16951/? A/DEBUG: #52 pc 00025d8d /dev/ashmem/dalvik-jit-code-cache (deleted) (android.os.Handler.handleCallback+52)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #53 pc 00019143 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.os.Handler.dispatchMessage+58)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #54 pc 0003be7d /dev/ashmem/dalvik-jit-code-cache (deleted) (android.os.Looper.loop+892)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #55 pc 00417dbb /system/lib/libart.so (art_quick_osr_stub+42)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #56 pc 0024ea41 /system/lib/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+1464)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #57 pc 003f08e7 /system/lib/libart.so (MterpMaybeDoOnStackReplacement+86)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #58 pc 004174f4 /system/lib/libart.so (ExecuteMterpImpl+66164)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #59 pc 00aef8fc /system/framework/boot-framework.vdex (android.os.Looper.loop+928)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #60 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #61 pc 001cc757 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #62 pc 001e34fb /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+754)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #63 pc 003eceeb /system/lib/libart.so (MterpInvokeStatic+130)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #64 pc 0040ab94 /system/lib/libart.so (ExecuteMterpImpl+14612)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #65 pc 00385e9a /system/framework/boot-framework.vdex (android.app.ActivityThread.main+214)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #66 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #67 pc 001cc6a3 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #68 pc 003df753 /system/lib/libart.so (artQuickToInterpreterBridge+890)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #69 pc 0041c2ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #70 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #71 pc 003f13eb /system/lib/libart.so (art_quick_invoke_static_stub+222)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #72 pc 000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #73 pc 00350a6d /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #74 pc 00351eb5 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+960)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #75 pc 00302bd9 /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+40)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #76 pc 001121ff /system/framework/arm/boot.oat (offset 0x10c000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #77 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #78 pc 003f12e7 /system/lib/libart.so (art_quick_invoke_stub+226)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #79 pc 000a1031 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #80 pc 001e8835 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+232)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #81 pc 001e3511 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+776)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #82 pc 003ebf0f /system/lib/libart.so (MterpInvokeVirtual+442)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #83 pc 0040aa14 /system/lib/libart.so (ExecuteMterpImpl+14228)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #84 pc 00c10612 /system/framework/boot-framework.vdex (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #85 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #86 pc 001cc6a3 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #87 pc 003df753 /system/lib/libart.so (artQuickToInterpreterBridge+890)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #88 pc 0041c2ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #89 pc 00a132d9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (com.android.internal.os.ZygoteInit.main+2896)
2022-03-17 04:06:26.020 16951-16951/? A/DEBUG: #90 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #91 pc 003f13eb /system/lib/libart.so (art_quick_invoke_static_stub+222)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #92 pc 000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #93 pc 00350a6d /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #94 pc 00350889 /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+304)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #95 pc 002949cd /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+476)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #96 pc 000c7425 /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2576)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #97 pc 000b9979 /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+40)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #98 pc 0006cb73 /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+38)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #99 pc 0006ed9b /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+462)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #100 pc 0000198d /system/bin/app_process32 (main+724)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #101 pc 00088f55 /system/lib/libc.so (__libc_init+48)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #102 pc 00001677 /system/bin/app_process32 (_start_main+46)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #103 pc 00019a27 /system/bin/linker (__dl__ZNSt3__112__hash_tableINS_17__hash_value_typeIjP6soinfoEENS_22__unordered_map_hasherIjS4_NS_4hashIjEELb1EEENS_21__unordered_map_equalIjS4_NS_8equal_toIjEELb1EEENS_9allocatorIS4_EEE14__erase_uniqueIjEEjRKT_+90)
2022-03-17 04:06:26.021 16951-16951/? A/DEBUG: #104 pc 007fec5a [stack:ff1a6000]
2022-03-17 04:06:26.715 3036-3036/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
2022-03-17 04:06:26.826 3203-3278/system_process E/InputDispatcher: channel 'a0d3512 com.sinwho.app/com.sinwho.app.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2022-03-17 04:06:26.827 3033-3099/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
2022-03-17 04:06:26.848 3033-16248/? E/ThreadWorker: pthread on exit wait clean
2022-03-17 04:06:26.890 3203-3221/system_process E/libprocessgroup: Error encountered killing process cgroup uid 99001 pid 4723: No such file or directory
2022-03-17 04:06:26.947 3003-3074/? E/BufferQueueProducer: [com.android.launcher3/com.android.launcher3.Launcher#0] disconnect: not connected (req=1)
Our Android application encounters random native crash in monkey test. We have some jni and native C++ code and have made some modification to try to solve the issue, but that didn't help. The crash stack don't have enough information to help to find the cause.
I could only static review the jni and C++ code, which is slow and helpless. The problem still exists after review. I am a Java developer and not so good at C++, so it is possible that I missed the problematic code. The C++ codebase is large because we used some open source project source code.
Following are some stacks:
/ CRASH: com.my.app (pid 27393)
// Short Msg: Native crash
// Long Msg: Native crash: Segmentation fault
// Build Label: Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys
// Build Changelist: 11.5.250_200614
// Build Time: 1592147934000
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Build fingerprint: 'Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys'
// Revision: '0'
// ABI: 'arm'
// Timestamp: 2020-10-15 22:44:46+0800
// pid: 27393, tid: 27407, name: ReferenceQueueD >>> com.my.app <<<
// uid: 10291
// signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
// Cause: null pointer dereference
// r0 b7e49de0 r1 00000000 r2 f087cd15 r3 00000000
// r4 f087cd15 r5 139b8330 r6 139b8330 r7 139b82c8
// r8 00000000 r9 eb15f600 r10 70ea2bd8 r11 139b8308
// ip e5b72bd5 sp c7e43dc0 lr 71c713bb pc f087cd1c
//
// backtrace:
// #00 pc 000add1c /system/lib/libandroid_runtime.so (android::CanvasJNI::delete_canvas(android::Canvas*)+8) (BuildId: 474c53cb68297e45cf00595c65e14fff)
// #01 pc 0004a3b9 /system/framework/arm/boot-core-libart.oat (art_jni_trampoline+120) (BuildId: 533d0af7f4307f5a947d9059c8a7d3c40eb37d1b)
// #02 pc 000bb60f /system/framework/arm/boot-core-libart.oat (libcore.util.NativeAllocationRegistry$CleanerThunk.run+78) (BuildId: 533d0af7f4307f5a947d9059c8a7d3c40eb37d1b)
// #03 pc 0024574b /system/framework/arm/boot.oat (sun.misc.Cleaner.clean+90) (BuildId: 625e004ba4396bf9751878502697218d94469522)
// #04 pc 000d3849 /system/framework/arm/boot.oat (java.lang.ref.ReferenceQueue.enqueueLocked+168) (BuildId: 625e004ba4396bf9751878502697218d94469522)
// #05 pc 000d3925 /system/framework/arm/boot.oat (java.lang.ref.ReferenceQueue.enqueuePending+148) (BuildId: 625e004ba4396bf9751878502697218d94469522)
// #06 pc 000ef941 /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$ReferenceQueueDaemon.runInternal+232) (BuildId: 533d0af7f4307f5a947d9059c8a7d3c40eb37d1b)
// #07 pc 0009e263 /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$Daemon.run+146) (BuildId: 533d0af7f4307f5a947d9059c8a7d3c40eb37d1b)
// #08 pc 00173691 /system/framework/arm/boot.oat (java.lang.Thread.run+64) (BuildId: 625e004ba4396bf9751878502697218d94469522)
// #09 pc 000d7bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #10 pc 0043d13d /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+248) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #11 pc 000dff81 /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+168) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #12 pc 0037d507 /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #13 pc 0037e29b /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+302) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #14 pc 003afeff /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+1018) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #15 pc 000ab3bd /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// #16 pc 00061989 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// CRASH: com.my.app (pid 10788)
// Short Msg: Native crash
// Long Msg: Native crash: Segmentation fault
// Build Label: Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys
// Build Changelist: 11.5.250_200614
// Build Time: 1592147934000
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Build fingerprint: 'Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys'
// Revision: '0'
// ABI: 'arm'
// Timestamp: 2020-10-16 01:51:56+0800
// pid: 10788, tid: 11437, name: RenderThread >>> com.my.app <<<
// uid: 10291
// signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38
// Cause: null pointer dereference
// r0 c5ddb380 r1 00000000 r2 c607d148 r3 00000000
// r4 bebe9710 r5 c607d148 r6 00000000 r7 bebe9000
// r8 ef9a30c0 r9 ef9a30e4 r10 ef9a30e8 r11 f050c018
// ip ef9a3a28 sp c607d070 lr ef98611b pc ef95e6b8
//
// backtrace:
// #00 pc 0005a6b8 /system/lib/libgui.so (android::HpGraphicBufferProducer::query(int, int*)+4) (BuildId: 4aade65846c0a0844ffc6abd2cfae7f4)
// #01 pc 00082119 /system/lib/libgui.so (android::Surface::query(int, int*) const+132) (BuildId: 4aade65846c0a0844ffc6abd2cfae7f4)
// #02 pc 001f9073 /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::getNextFrameSize() const+20) (BuildId: 27f32025e8036c1421e970591d6452bf)
// #03 pc 001f9045 /system/lib/libhwui.so (android::uirenderer::TreeInfo::TreeInfo(android::uirenderer::TreeInfo::TraversalMode, android::uirenderer::renderthread::CanvasContext&)+104) (BuildId: 27f32025e8036c1421e970591d6452bf)
// #04 pc 001f8da7 /system/lib/libhwui.so (android::uirenderer::renderthread::DrawFrameTask::run()+74) (BuildId: 27f32025e8036c1421e970591d6452bf)
// #05 pc 0020742d /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+164) (BuildId: 27f32025e8036c1421e970591d6452bf)
// #06 pc 0020727f /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+54) (BuildId: 27f32025e8036c1421e970591d6452bf)
// #07 pc 0000d96f /system/lib/libutils.so (android::Thread::_threadLoop(void*)+210) (BuildId: 303a9d221465f0db9b5d760e0a0c6abe)
// #08 pc 000ab3bd /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// #09 pc 00061989 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// CRASH: com.my.app (pid 7417)
// Short Msg: Native crash
// Long Msg: Native crash: Segmentation fault
// Build Label: Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys
// Build Changelist: 11.5.250_200614
// Build Time: 1592147934000
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Build fingerprint: 'Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys'
// Revision: '0'
// ABI: 'arm'
// Timestamp: 2020-10-16 07:57:24+0800
// pid: 7417, tid: 28261, name: speakLocal tts >>> com.my.app <<<
// uid: 10291
// signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffff4
// r0 df8becc0 r1 00000000 r2 00000000 r3 00000001
// r4 df81ad20 r5 b356b6e0 r6 ef17a9b1 r7 000000a8
// r8 00000000 r9 ef1a4ad4 r10 ef1a4d08 r11 0065c5c0
// ip ef1a4ec4 sp b356b690 lr ef1933fd pc ef1935b4
//
// backtrace:
// #00 pc 000445b4 /system/lib/libmedia.so (android::IMediaDeathNotifier::getMediaPlayerService()+476) (BuildId: 4c77835059177de2000d6c39f9539962)
// #01 pc 0002b9cf /system/lib/libmedia.so (android::MediaPlayer::setDataSource(int, long long, long long)+30) (BuildId: 4c77835059177de2000d6c39f9539962)
// #02 pc 0003b873 /system/lib/libmedia_jni.so (android_media_MediaPlayer_setDataSourceFD(_JNIEnv*, _jobject*, _jobject*, long long, long long)+118) (BuildId: c190a7c755ffba7708c716e1dd16c0a1)
// #03 pc 0029c637 /system/framework/arm/boot-framework.oat (art_jni_trampoline+126) (BuildId: 39c685939f0d8867d4162c7a38d63ad3600807fd)
// #04 pc 006ce41b /system/framework/arm/boot-framework.oat (android.media.MediaPlayer.setDataSource+58) (BuildId: 39c685939f0d8867d4162c7a38d63ad3600807fd)
// #05 pc 006ce365 /system/framework/arm/boot-framework.oat (android.media.MediaPlayer.setDataSource+172) (BuildId: 39c685939f0d8867d4162c7a38d63ad3600807fd)
// #06 pc 000d7bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #07 pc 0043d13d /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+248) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #08 pc 000dff81 /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+168) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #09 pc 00214673 /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+270) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #10 pc 00210867 /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #11 pc 00437927 /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+458) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #12 pc 000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #13 pc 00455d68 /data/app/com.lenovo.menu_assistant-XzP2MzG5jMAB7n94-EP3IQ==/oat/arm/base.vdex (sy.B+1356)
// #14 pc 00437b91 /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+1076) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #15 pc 000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #16 pc 004555cc /data/app/com.lenovo.menu_assistant-XzP2MzG5jMAB7n94-EP3IQ==/oat/arm/base.vdex (sy.e)
// #17 pc 00434c9f /apex/com.android.runtime/lib/libart.so (MterpInvokeStatic+934) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #18 pc 000d2994 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_static+20) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #19 pc 00453e6c /data/app/com.lenovo.menu_assistant-XzP2MzG5jMAB7n94-EP3IQ==/oat/arm/base.vdex (sy$g.run+12)
// #20 pc 001f068f /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.8590219860024250152+166) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #21 pc 001f50a3 /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+122) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #22 pc 00426b97 /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+866) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #23 pc 000dc5a1 /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+32) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #24 pc 00173691 /system/framework/arm/boot.oat (java.lang.Thread.run+64) (BuildId: 625e004ba4396bf9751878502697218d94469522)
// #25 pc 000d7bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #26 pc 0043d13d /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+248) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #27 pc 000dff81 /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+168) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #28 pc 0037d507 /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #29 pc 0037e29b /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+302) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #30 pc 003afeff /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+1018) (BuildId: 78cb259cd8aba2a9f6063413910ab653)
// #31 pc 000ab3bd /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// #32 pc 00061989 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
I wanted to try the litho library from facebook for recycler view. Read the official docs and few other articles, and i started implementing using a basic example of hello world. But the app shows a white screen and crashes without displaying anything.
Searched online and few told to add multidex support, but multidex is by default enabled after sdk version 23. will attach my logcat for ref.
2020-03-16 12:22:23.407 21721-21721/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 21721 (e.lithopractice), pid 21721 (e.lithopractice)
2020-03-16 12:22:23.443 21741-21763/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: Build fingerprint: 'motorola/sanders_n/sanders_n:8.1.0/OPS28.65-36-14/63857:user/release-keys'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: Revision: 'p400'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: ABI: 'arm'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: pid: 21721, tid: 21721, name: e.lithopractice >>> com.example.lithopractice <<<
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: Abort message: 'java_vm_ext.cc:553] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "com.facebook.jni.HybridData$Destructor" on path: DexPathList[[zip file "/data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/lib/arm, /data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/base.apk!/lib/armeabi-v7a, /system/lib,
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: r0 00000000 r1 000054d9 r2 00000006 r3 00000008
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: r4 000054d9 r5 000054d9 r6 beac46d4 r7 0000010c
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: r8 00000000 r9 ae499380 sl 0000000a fp beac4720
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: ip a65a5de0 sp beac46c0 lr af1be92d pc af1b841a cpsr 200f0030
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: backtrace:
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #00 pc 0001a41a /system/lib/libc.so (abort+63)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #01 pc 0035ce99 /system/lib/libart.so (art::Runtime::Abort(char const*)+392)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #02 pc 0041ca0d /system/lib/libart.so (android::base::LogMessage::~LogMessage()+452)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #03 pc 0024eb19 /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1212)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #04 pc 0024ec9b /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+58)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #05 pc 000d61d3 /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+42)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: #06 pc 000d5d53 /system/lib/libart.so (art::ScopedCheck::CheckThread(_JNIEnv*)+274)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #07 pc 000d46fd /system/lib/libart.so (art::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::JniValueType*)+596)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #08 pc 000d6aaf /system/lib/libart.so (art::CheckJNI::NewRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+434)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #09 pc 003814a1 /system/lib/libart.so (art::Thread::SetClassLoaderOverride(_jobject*)+32)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #10 pc 002509fb /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*, _jstring*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+1910)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #11 pc 0000315f /system/lib/libopenjdkjvm.so (JVM_NativeLoad+194)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #12 pc 00254641 /system/framework/arm/boot-core-oj.oat (offset 0x1cb000) (java.lang.Runtime.nativeLoad+160)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #13 pc 00403375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #14 pc 004085eb /system/lib/libart.so (art_quick_invoke_static_stub+226)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #15 pc 000b00df /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+174)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #16 pc 0035769d /system/lib/libart.so (art::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::ArgArray*, art::JValue*, char const*)+52)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #17 pc 00358bbb /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+954)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #18 pc 00308645 /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobject*)+40)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #19 pc 002389ff /system/framework/arm/boot-core-oj.oat (offset 0x1cb000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #20 pc 00403375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #21 pc 004084e5 /system/lib/libart.so (art_quick_invoke_stub+228)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG: #22 pc 000b00bb /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+138)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #23 pc 00201f3b /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+226)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #24 pc 001fd4bd /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+592)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #25 pc 003ed49b /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #26 pc 003f5714 /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #27 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #28 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #29 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #30 pc 003ee087 /system/lib/libart.so (MterpInvokeInterface+1078)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #31 pc 003f5914 /system/lib/libart.so (ExecuteMterpImpl+14740)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #32 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #33 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #34 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #35 pc 003ed49b /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #36 pc 003f5714 /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #37 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #38 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #39 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #40 pc 003ed49b /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #41 pc 003f5714 /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #42 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #43 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #44 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #45 pc 003ee4b5 /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #46 pc 003f5894 /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #47 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #48 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #49 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #50 pc 003ee4b5 /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #51 pc 003f5894 /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #52 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #53 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #54 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #55 pc 003ee4b5 /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG: #56 pc 003f5894 /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #57 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #58 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #59 pc 001fd4a5 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #60 pc 003ee347 /system/lib/libart.so (MterpInvokeDirect+250)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #61 pc 003f5814 /system/lib/libart.so (ExecuteMterpImpl+14484)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #62 pc 001e3f11 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG: #63 pc 001e85d5 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:24.114 21767-21775/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
2020-03-16 12:22:24.861 1171-1171/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_07 ```
Adding the following dependecy solves the problem. Just incase anyone ever needs it.
implementation 'com.facebook.fbjni:fbjni:0.0.2'