I get a lot of errors in a library called libc.so
We don't have any native code in our project so I'm wondering if these are coming from one of our dependencies.
If so, how do I understand which library is causing this issue?
Crash 1
Crashed: Thread : SIGABRT 0x000027bf00002899
#00 pc 0x787cf895ac libc.so
#01 pc 0x787cf8957c libc.so
#02 pc 0x77fc6da720 libart.so
#03 pc 0x78801dd600 libbase.so
#04 pc 0x77fc666a3c libart.so
#05 pc 0x77fc66e4b0 libart.so
#06 pc 0x77fc67c68c libart.so
#07 pc 0x77fc6e7b84 libart.so
#08 pc 0x77fc6fbacc libart.so
#09 pc 0x77fc6fab60 libart.so
#10 pc 0x787cfe86f0 libc.so
#11 pc 0x787cf8b0e8 libc.so
Crash 2
Crashed: Thread : SIGTRAP 0x000027a0000005f5
#00 pc 0x773bbea6b4 base.apk
#01 pc 0x773bbea560 base.apk
#02 pc 0x773d1d3cb0 base.apk
#03 pc 0x773a570408 base.apk
#04 pc 0x773c2bfea0 base.apk
#05 pc 0x773c220278 base.apk
#06 pc 0x773cbd7d08 base.apk
#07 pc 0x773cbd7ccc base.apk
#08 pc 0x773cbd7c54 base.apk
#09 pc 0x7819831dbc libutils.so
#10 pc 0x78198319c4 libutils.so
#11 pc 0x781baff63c libandroid_runtime.so
#12 pc 0x703cc724
#13 pc 0x6fcb192c
#14 pc 0x6fc7b61c
#15 pc 0x71af7f24 boot-framework.oat
#16 pc 0x703cc9cc
#17 pc 0x71536f88 boot-framework.oat
#18 pc 0x6f84119c
#19 pc 0x6f8a9aac
#20 pc 0x6fff698c
#21 pc 0x6f8ad0a4
#22 pc 0x6fc859dc
#23 pc 0x71af4a78 boot-framework.oat
#24 pc 0x702570c4
#25 pc 0x6fc80bbc
#26 pc 0x6f8ad3b4
#27 pc 0x6f8ad3b4
#28 pc 0x6fc80bbc
#29 pc 0x6ffc7f44
#30 pc 0x717cfb30 boot-framework.oat
#31 pc 0x703f966c
#32 pc 0x703f8294
#33 pc 0x779791bc04 libart.so
#34 pc 0x77975495b8 libart.so
#35 pc 0x703f966c
#36 pc 0x77975581c4 libart.so
#37 pc 0x703f966c
#38 pc 0x703f966c
#39 pc 0x77978ce508 libart.so
#40 pc 0x6fc80bbc
#41 pc 0x6fc80bbc
#42 pc 0x77979ac218 libart.so
#43 pc 0x703f966c
#44 pc 0x6fc80bbc
#45 pc 0x703f966c
#46 pc 0x77978cff30 libart.so
#47 pc 0x6fc80bbc
#48 pc 0x70e01da0 boot.oat
#49 pc 0x6f9dd14c
#50 pc 0x6f8cf454
#51 pc 0x70e05478 boot.oat
#52 pc 0x6f9dd8f4
#53 pc 0x6fa8c78c
#54 pc 0x6fc80bbc
#55 pc 0x6f8cf454
#56 pc 0x6f7b39e4
#57 pc 0x71d73fa0 boot-framework.oat
#58 pc 0x703abf6c
#59 pc 0x71d73b4c boot-framework.oat
#60 pc 0x703abef4
#61 pc 0x700543bc
#62 pc 0x700543bc
#63 pc 0x71d781c8 boot-framework.oat
crash 3
Crashed: Thread : SIGABRT 0x000027ce00006d26
#00 pc 0x7c556075ac libc.so
#01 pc 0x7c5560757c libc.so
#02 pc 0x7bd26da720 libart.so
#03 pc 0x7c56d77600 libbase.so
#04 pc 0x7bd2666a3c libart.so
#05 pc 0x7bd266e4b0 libart.so
#06 pc 0x7bd267c68c libart.so
#07 pc 0x7bd26e7b84 libart.so
#08 pc 0x7bd26fbacc libart.so
#09 pc 0x7bd26fab60 libart.so
#10 pc 0x7c556666f0 libc.so
#11 pc 0x7c556090e8 libc.so
I'm seeing this native crash with the following stack trace.
I have checked other questions similar to this but doesn't found anything similar solution as I have not used TextureView or CardView and I am also sure that it is not due to any library dependencies.
Can anyone have clue, Please?
#00 pc 000000000004ae30 /system/lib/libc.so (tgkill+12)
#01 pc 00000000000485c3 /system/lib/libc.so (pthread_kill+34)
#02 pc 000000000001de5d /system/lib/libc.so (raise+10)
#03 pc 0000000000019561 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 00000000000171a0 /system/lib/libc.so (abort+4)
#05 pc 000000000031e8fd /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+328)
#06 pc 00000000000b56d7 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+1134)
#07 pc 00000000001be831 /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+308)
#08 pc 000000000023c917 /system/lib/libart.so (_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadEPNS_6mirror6ObjectE+46)
#09 pc 00000000002822ef /system/lib/libart.so (_ZN3art3JNI16NewWeakGlobalRefEP7_JNIEnvP8_jobject+418)
#10 pc 0000000000090abb /system/lib/libandroid_runtime.so
#11 pc 00000000029950cd /system/framework/arm/boot-framework.oat (android.view.RenderNode.nCreate+96)
#12 pc 0000000002994e23 /system/framework/arm/boot-framework.oat (android.view.RenderNode.<init>+70)
#13 pc 0000000002994f91 /system/framework/arm/boot-framework.oat (android.view.RenderNode.create+68)
#14 pc 00000000027526e3 /system/framework/arm/boot-framework.oat (android.view.View.<init>+750)
#15 pc 0000000002752a57 /system/framework/arm/boot-framework.oat (android.view.View.<init>+66)
#16 pc 0000000002a6d831 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+148)
#17 pc 0000000002a6d765 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+64)
#18 pc 0000000002a6d6f1 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+60)
#19 pc 0000000002a6d683 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+46)
#20 pc 000000000003bd5b /dev/ashmem/dalvik-jit-code-cache_17678_17678 (deleted)
Native crash at getResources().getStringArray on some devices such as Samsung On7 Pro and Samsung Galaxy J8. On other devices same code is working fine. I am not able to figure out what is wrong. Below is the stack trace of crash.
backtrace:
#00 pc 000000000004b95c /system/lib/libc.so (tgkill+12)
#01 pc 000000000001a733 /system/lib/libc.so (abort+54)
#02 pc 0000000000337da3 /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+230)
#03 pc 0000000000338433 /system/lib/libart.so (_ZN3art7Runtime7AborterEPKc+10)
#04 pc 00000000003efaad /system/lib/libart.so (_ZN7android4base10LogMessageD1Ev+456)
#05 pc 00000000002300df /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1262)
#06 pc 000000000023033b /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+66)
#07 pc 000000000028b3f7 /system/lib/libart.so (_ZN3art3JNI9NewStringEP7_JNIEnvPKti+590)
#08 pc 00000000000ea39d /system/lib/libandroid_runtime.so (_ZN7androidL51android_content_AssetManager_getArrayStringResourceEP7_JNIEnvP8_jobjecti+244)
#09 pc 0000000000a51567 /system/framework/arm/boot-framework.oat (android.content.res.AssetManager.getArrayStringInfo [DEDUPED]+78)
#10 pc 0000000000a596ff /system/framework/arm/boot-framework.oat (android.content.res.Resources.getStringArray+86)
#11 pc 00000000003dd1e1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#12 pc 00000000003e1755 /system/lib/libart.so (art_quick_invoke_stub+228)
#13 pc 00000000000ac0e1 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+140)
#14 pc 00000000001f1cf3 /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+238)
#15 pc 00000000001ed2a3 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+574)
#16 pc 00000000003c9691 /system/lib/libart.so (MterpInvokeVirtualQuick+504)
#17 pc 00000000003d3214 /system/lib/libart.so (ExecuteMterpImpl+29972)
#18 pc 00000000001d4825 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+340)
#19 pc 00000000001d9ba7 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+142)
#20 pc 00000000001ed28d /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+552)
#21 pc 00000000003c7f71 /system/lib/libart.so (MterpInvokeDirect+360)
#22 pc 00000000003cf594 /system/lib/libart.so (ExecuteMterpImpl+14484)
#23 pc 00000000001d4825 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+340)
#24 pc 00000000001d9af5 /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+92)
#25 pc 00000000003bd7f5 /system/lib/libart.so (artQuickToInterpreterBridge+960)
#26 pc 00000000003e0fa1 /system/lib/libart.so (art_quick_to_interpreter_bridge+32)
#27 pc 00000000007eebc5 /system/framework/arm/boot-framework.oat (android.app.Instrumentation.callActivityOnCreate+108)
#28 pc 0000000000712309 /system/framework/arm/boot-framework.oat (android.app.ActivityThread.performLaunchActivity+1936)
#29 pc 000000000070a21b /system/framework/arm/boot-framework.oat (android.app.ActivityThread.handleLaunchActivity+298)
#30 pc 00000000006fe84f /system/framework/arm/boot-framework.oat (android.app.ActivityThread.-wrap11+62)
#31 pc 00000000006fb5c5 /system/framework/arm/boot-framework.oat (android.app.ActivityThread$H.handleMessage+8676)
#32 pc 0000000000e94cfb /system/framework/arm/boot-framework.oat (android.os.Handler.dispatchMessage+138)
#33 pc 0000000000ee3243 /system/framework/arm/boot-framework.oat (android.os.Looper.loop+1066)
#34 pc 000000000071036d /system/framework/arm/boot-framework.oat (android.app.ActivityThread.main+932)
#35 pc 00000000003dd1e1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#36 pc 00000000003e185b /system/lib/libart.so (art_quick_invoke_static_stub+226)
#37 pc 00000000000ac10b /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+182)
#38 pc 000000000033215d /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+52)
#39 pc 00000000003336a3 /system/lib/libart.so (_ZN3art12InvokeMethodERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectS4_S4_j+946)
#40 pc 00000000002e1475 /system/lib/libart.so (_ZN3artL13Method_invokeEP7_JNIEnvP8_jobjectS3_S3_+40)
#41 pc 0000000000250bdf /system/framework/arm/boot-core-oj.oat (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
#42 pc 000000000162b055 /system/framework/arm/boot-framework.oat (com.android.internal.os.Zygote$MethodAndArgsCaller.run+124)
#43 pc 000000000162f245 /system/framework/arm/boot-framework.oat (com.android.internal.os.ZygoteInit.main+3076)
#44 pc 00000000003dd1e1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#45 pc 00000000003e185b /system/lib/libart.so (art_quick_invoke_static_stub+226)
#46 pc 00000000000ac10b /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+182)
#47 pc 000000000033215d /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+52)
#48 pc 0000000000331f69 /system/lib/libart.so (_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDSt9__va_list+296)
#49 pc 0000000000285c83 /system/lib/libart.so (_ZN3art3JNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+430)
#50 pc 00000000000a0f41 /system/lib/libandroid_runtime.so (_ZN7_JNIEnv20CallStaticVoidMethodEP7_jclassP10_jmethodIDz+36)
#51 pc 00000000000a284b /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+466)
#52 pc 0000000000003215 /system/bin/app_process32 (main+1180)
#53 pc 0000000000017e89 /system/lib/libc.so (__libc_init+48)
#54 pc 0000000000002ca0 /system/bin/app_process32 (_start+96)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
#00 pc 0x50f8e /system/lib/libdvm.so (dvmAbort+89)
#01 pc 0x59ee1 /system/lib/libdvm.so (dvmLinearAlloc(Object*, unsigned int)+64)
#02 pc 0x76a7b /system/lib/libdvm.so (???)
#03 pc 0x76d77 /system/lib/libdvm.so (dvmDefineClass(DvmDex*, char const*, Object*)+10)
#04 pc 0x71583 /system/lib/libdvm.so (???)
#05 pc 0x30c0c /system/lib/libdvm.so (???)
#06 pc 0x343dc /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#07 pc 0x6d109 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+284)
#08 pc 0x6d12d /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#09 pc 0x76e69 /system/lib/libdvm.so (dvmFindClassNoInit(char const*, Object*)+108)
#10 pc 0x6216b /system/lib/libdvm.so (???)
#11 pc 0x62287 /system/lib/libdvm.so (???)
#12 pc 0x65a6d /system/lib/libdvm.so (dvmVerifyCodeFlow(VerifierData*)+9760)
#13 pc 0x68c91 /system/lib/libdvm.so (???)
#14 pc 0x68ce3 /system/lib/libdvm.so (dvmVerifyClass(ClassObject*)+42)
#15 pc 0x7704d /system/lib/libdvm.so (dvmInitClass+116)
#16 pc 0x742d1 /system/lib/libdvm.so (???)
#17 pc 0x30c0c /system/lib/libdvm.so (???)
#18 pc 0x343dc /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#19 pc 0x6ce39 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+344)
#20 pc 0x73b19 /system/lib/libdvm.so (???)
#21 pc 0x30c0c /system/lib/libdvm.so (???)
#22 pc 0x343dc /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#23 pc 0x6ce39 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+344)
#24 pc 0x7431b /system/lib/libdvm.so (???)
#25 pc 0x30c0c /system/lib/libdvm.so (???)
#26 pc 0x343dc /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#27 pc 0x6d109 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+284)
#28 pc 0x554af /system/lib/libdvm.so (???)
#29 pc 0x48c6b /system/lib/libandroid_runtime.so (???)
#30 pc 0x4a81f /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+394)
#31 pc 0xf0d /system/bin/app_process (???)
java.lang.Throwable:
******* Java stack for JNI crash *******
at dalvik.system.DexFile.defineClass(Native Method)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:195)
at dalvik.system.DexPathList.findClass(DexPathList.java:315)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:58)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.lily.dexLoader.invokeStaticMethod(SourceFile:70)
at com.lily.sdk.Web.<init>(SourceFile:77)
......
I can not reproduce this crash through my android app, but the monitor system reports this kind of crash many times.
It is not clear whether the dex is broken or the system dalvik is not stable.
Does anyone has any experience on this kind of loadClass crash?
If the VM detects a serious problem, it will send diagnostics to the log, and abort. The VM in the version of Android you're using crashes itself by attempting to write to a read-only location (0xdeadd00d).
Looking at the stack trace, the last thing before dvmAbort() is dvmLinearAlloc(). Looking at a recent source file, the VM will abort in that function if it runs out of memory to allocate, or if it's unable to change the permissions on a page while in a special debug mode where pages are aggressively marked read-only. It's almost certainly the former. Looking at the logcat output would tell you for sure.
Assuming you're running out of memory, I'd guess you're running an old version of Android (<= gingerbread), where the "linear alloc" buffer was under-sized. This region of memory is used to hold class meta-data, such as tables of methods and fields, but not the data itself (which is why it can be marked read-only to help hunt for memory trashers). The only way to avoid the problem is to restructure the classes.
You can read more about the problem, and a solution deployed by Facebook engineers, in this blog post.
The following code will cause dvmAbort() when getting package name. But the context object was the global Application object, this reference should be valid.
I want to catch this exception or resolve this crash, Who can help me?
jclass ctx_class = env->GetObjectClass(context);
>>> Backtrace <<<
#00 pc 00022184 /system/lib/libc.so (tgkill+12)
#01 pc 000131d9 /system/lib/libc.so (pthread_kill+48)
#02 pc 000133ed /system/lib/libc.so (raise+10)
#03 pc 00012123 /system/lib/libc.so (?+0)
#04 pc 00021a38 /system/lib/libc.so (abort+4)
#05 pc 00048c9f /system/lib/libdvm.so (dvmAbort+78)
#06 pc 0004d607 /system/lib/libdvm.so (dvmDecodeIndirectRef(Thread*, _jobject*)+146)
#07 pc 0005018b /system/lib/libdvm.so (?+0)
#10 pc 000204cc /system/lib/libdvm.so (dvmPlatformInvoke+112)
#11 pc 00051157 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
#12 pc 00052b41 /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+184)
#13 pc 00029960 /system/lib/libdvm.so (?+0)
#14 pc 00030dec /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#15 pc 0002e484 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#16 pc 000635b9 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#17 pc 000635dd /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#18 pc 000582bb /system/lib/libdvm.so (?+0)
#19 pc 0000d2c8 /system/lib/libc.so (__thread_entry+72)
#20 pc 0000d460 /system/lib/libc.so (pthread_create+240)