Android rom开发:app运行异常,报libc: Fatal signal 11 (SIGSEGV) in tid xxx错误

  • Post author:
  • Post category:其他


最近遇到了app在设备上反复挂掉的问题。log如下:

2020-03-07 13:20:24.814 16858-16858/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.hello.test/shared_prefs/authStatus_com.hello.test��������������������������������������������������������������������������������������������������������������������������.xml
2020-03-07 13:20:24.814 16858-16858/? E/PermissionCheck: permission check result is: 601
2020-03-07 13:20:24.845 16858-16858/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23.20190613
2020-03-07 13:20:24.852 16858-16876/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-07 13:20:24.853 16858-16876/? I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-03-07 13:20:25.169 3865-4680/? D/GraphicsStats: Buffer count: 3
2020-03-07 13:20:25.170 3865-5763/? I/ActivityManager: Process com.hello.test (pid 16858) has died
2020-03-07 13:20:25.170 3865-5763/? D/ActivityManager: cleanUpApplicationRecord -- 16858
2020-03-07 13:20:25.175 497-497/? I/Zygote: Process 16858 exited due to signal (11)
2020-03-07 13:20:25.191 3865-5763/? I/ActivityManager: Start proc 16887:com.hello.test/u0a74 for activity com.hello.test/com.baidu.track.activity.SplashActivity
2020-03-07 13:20:25.192 3865-5763/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@9494711
2020-03-07 13:20:25.305 16887-16887/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23
2020-03-07 13:20:25.319 16887-16887/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.hello.test/shared_prefs/authStatus_com.hello.test��������������������������������������������������������������������������������������������������������������������������.xml
2020-03-07 13:20:25.319 16887-16887/? E/PermissionCheck: permission check result is: 601
2020-03-07 13:20:25.354 16887-16887/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23.20190613
2020-03-07 13:20:25.356 16887-16905/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-07 13:20:25.357 16887-16905/? I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-03-07 13:20:25.521 3865-5046/? I/ActivityManager: Process com.hello.test (pid 16887) has died
2020-03-07 13:20:25.521 3865-5046/? D/ActivityManager: cleanUpApplicationRecord -- 16887
2020-03-07 13:20:25.525 497-497/? I/Zygote: Process 16887 exited due to signal (11)
2020-03-07 13:20:25.549 3865-5046/? I/ActivityManager: Start proc 16914:com.hello.test/u0a74 for activity com.hello.test/com.baidu.track.activity.SplashActivity
2020-03-07 13:20:25.549 3865-5046/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@26c7677
2020-03-07 13:20:25.651 16914-16914/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23
2020-03-07 13:20:25.666 16914-16914/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.hello.test/shared_prefs/authStatus_com.hello.test��������������������������������������������������������������������������������������������������������������������������.xml
2020-03-07 13:20:25.666 16914-16914/? E/PermissionCheck: permission check result is: 601
2020-03-07 13:20:25.698 16914-16914/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23.20190613
2020-03-07 13:20:25.701 16914-16932/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-07 13:20:25.704 16914-16932/? I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-03-07 13:20:25.917 3865-4875/? I/ActivityManager: Process com.hello.test (pid 16914) has died
2020-03-07 13:20:25.917 3865-4875/? D/ActivityManager: cleanUpApplicationRecord -- 16914
2020-03-07 13:20:25.920 497-497/? I/Zygote: Process 16914 exited due to signal (11)
2020-03-07 13:20:25.940 3865-4875/? I/ActivityManager: Start proc 16941:com.hello.test/u0a74 for activity com.hello.test/com.baidu.track.activity.SplashActivity
2020-03-07 13:20:25.940 3865-4875/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@6ea434d
2020-03-07 13:20:26.059 16941-16941/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23
2020-03-07 13:20:26.072 16941-16941/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.hello.test/shared_prefs/authStatus_com.hello.test��������������������������������������������������������������������������������������������������������������������������.xml
2020-03-07 13:20:26.073 16941-16941/? E/PermissionCheck: permission check result is: 601
2020-03-07 13:20:26.105 16941-16941/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23.20190613
2020-03-07 13:20:26.107 16941-16959/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-07 13:20:26.109 16941-16959/? I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-03-07 13:20:26.280 3865-5046/? I/ActivityManager: Process com.hello.test (pid 16941) has died
2020-03-07 13:20:26.280 3865-5046/? D/ActivityManager: cleanUpApplicationRecord -- 16941
2020-03-07 13:20:26.287 497-497/? I/Zygote: Process 16941 exited due to signal (11)
2020-03-07 13:20:26.316 3865-5046/? I/ActivityManager: Start proc 16968:com.hello.test/u0a74 for activity com.hello.test/com.baidu.track.activity.SplashActivity
2020-03-07 13:20:26.317 3865-5046/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@7280313
2020-03-07 13:20:26.426 16968-16968/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23
2020-03-07 13:20:26.440 16968-16968/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.hello.test/shared_prefs/authStatus_com.hello.test��������������������������������������������������������������������������������������������������������������������������.xml
2020-03-07 13:20:26.441 16968-16968/? E/PermissionCheck: permission check result is: 601
2020-03-07 13:20:26.474 16968-16986/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-07 13:20:26.474 16968-16986/? I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-03-07 13:20:26.475 16968-16968/? I/BaiduApiAuth: BaiduApiAuth SDK Version:1.0.23.20190613
    
    --------- beginning of crash
2020-03-07 13:20:26.565 16968-16986/? A/libc: Fatal signal 11 (SIGSEGV) in tid 16986 (Thread-2)
2020-03-07 13:20:26.582 4929-4929/? D/wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
2020-03-07 13:20:26.585 4929-4929/? D/wpa_supplicant: CTRL-DEBUG: global_ctrl_sock-sendto: sock=8 sndbuf=163840 outq=0 send_len=48
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: Build fingerprint: 'qcom/msm8909/msm8909:7.1.2/N2G47H/7.20.0306.01:user/release-keys'
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: Revision: '0'
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: ABI: 'arm'
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: pid: 16968, tid: 16986, name: Thread-2  >>> com.hello.test <<<
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG: signal 11 (SIGSEGV), code 0 (SI_USER), fault addr 0x4248
2020-03-07 13:20:26.673 16995-16995/? A/DEBUG:     r0 70a3d8a8  r1 00000000  r2 00000002  r3 91082700
2020-03-07 13:20:26.674 16995-16995/? A/DEBUG:     r4 910826fc  r5 00000000  r6 00000001  r7 91082640
2020-03-07 13:20:26.674 16995-16995/? A/DEBUG:     r8 00100015  r9 910826a4  sl 91082700  fp 910826bc
2020-03-07 13:20:26.674 16995-16995/? A/DEBUG:     ip 91082624  sp 91082558  lr a8928fd1  pc a8928fd2  cpsr 000a0030
2020-03-07 13:20:27.746 16995-16995/? A/DEBUG: backtrace:
2020-03-07 13:20:27.746 16995-16995/? A/DEBUG:     #00 pc 00316fd2  /system/lib/libart.so (_ZN3art12InvokeMethodERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectS4_S4_j+69)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #01 pc 002b51f9  /system/lib/libart.so (_ZN3artL24Constructor_newInstance0EP7_JNIEnvP8_jobjectP13_jobjectArray+868)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #02 pc 005aaee5  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (java.lang.reflect.Constructor.newInstance0+96)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #03 pc 005ab929  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (java.lang.reflect.Constructor.newInstance+52)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #04 pc 007e2e4d  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.x509.X500Name.asX500Principal+88)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #05 pc 007eb9ad  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.x509.X509CertInfo.getX500Name+168)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #06 pc 007ecffb  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.x509.X509CertInfo.get+438)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #07 pc 007ea16b  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.x509.X509CertImpl.getSubjectX500Principal+70)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #08 pc 007e6199  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.x509.X509CertImpl.isSelfIssued+36)
2020-03-07 13:20:27.747 16995-16995/? A/DEBUG:     #09 pc 0079f2c3  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PolicyChecker.mergeExplicitPolicy+70)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #10 pc 0079efc5  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PolicyChecker.checkPolicy+1008)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #11 pc 007a1db7  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PolicyChecker.check+74)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #12 pc 0079e67d  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PKIXMasterCertPathValidator.validate+1168)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #13 pc 0079db3b  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PKIXCertPathValidator.validate+1318)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #14 pc 0079df97  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PKIXCertPathValidator.validate+938)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #15 pc 0079e16d  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (sun.security.provider.certpath.PKIXCertPathValidator.engineValidate+64)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #16 pc 0062513b  /system/framework/arm/boot-core-oj.oat (offset 0x51b000) (java.security.cert.CertPathValidator.validate+46)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #17 pc 000a4503  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.verifyChain+1070)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #18 pc 000a3b6d  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive+2216)
2020-03-07 13:20:27.748 16995-16995/? A/DEBUG:     #19 pc 000a3541  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive+636)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #20 pc 000a3827  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive+1378)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #21 pc 000a30a5  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.checkTrusted+416)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #22 pc 000a328f  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.checkTrusted+346)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #23 pc 000a4cf5  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer+136)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #24 pc 01cc7f63  /system/framework/arm/boot-framework.oat (offset 0x15c1000) (android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted+54)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #25 pc 01cc8b17  /system/framework/arm/boot-framework.oat (offset 0x15c1000) (android.security.net.config.RootTrustManager.checkServerTrusted+250)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #26 pc 0009d79d  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.Platform.checkServerTrusted+248)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #27 pc 00096e31  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain+540)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #28 pc 000a99c1  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #29 pc 004052f1  /system/lib/libart.so (art_quick_invoke_stub+232)
2020-03-07 13:20:27.749 16995-16995/? A/DEBUG:     #30 pc 000b0c55  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #31 pc 00315ef9  /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #32 pc 00316ea9  /system/lib/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDSt9__va_list+256)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #33 pc 0026a051  /system/lib/libart.so (_ZN3art3JNI15CallVoidMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+444)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #34 pc 0001193d  /system/lib/libjavacrypto.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #35 pc 00011ef9  /system/lib/libjavacrypto.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #36 pc 00016ed7  /system/lib/libssl.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #37 pc 0000fed5  /system/lib/libssl.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #38 pc 0000f093  /system/lib/libssl.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #39 pc 0000e8e9  /system/lib/libjavacrypto.so
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #40 pc 0007989f  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.NativeCrypto.SSL_do_handshake+210)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #41 pc 00096575  /system/framework/arm/boot-conscrypt.oat (offset 0x6c000) (com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake+1072)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #42 pc 0008c013  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.Connection.connectTls+398)
2020-03-07 13:20:27.750 16995-16995/? A/DEBUG:     #43 pc 0008bd6d  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.Connection.connectSocket+184)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #44 pc 0008d043  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.Connection.connect+678)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #45 pc 0008d2ab  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.Connection.connectAndSetOwner+190)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #46 pc 0009b949  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.OkHttpClient$1.connectAndSetOwner+52)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #47 pc 000b066b  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.http.HttpEngine.connect+334)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #48 pc 000b2df3  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.http.HttpEngine.sendRequest+462)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #49 pc 000b8bd5  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute+128)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #50 pc 000b9deb  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect+54)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #51 pc 000ba44f  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream+42)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #52 pc 000b8005  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream+40)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #53 pc 000bbe0f  /system/framework/arm/boot-okhttp.oat (offset 0x86000) (com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream+42)
2020-03-07 13:20:27.751 16995-16995/? A/DEBUG:     #54 pc 000a99c1  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #55 pc 004052f1  /system/lib/libart.so (art_quick_invoke_stub+232)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #56 pc 000b0c55  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #57 pc 001ed0d5  /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+200)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #58 pc 001e7685  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+492)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #59 pc 003ff76b  /system/lib/libart.so (MterpInvokeVirtualQuick+322)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #60 pc 000a0594  /system/lib/libart.so (ExecuteMterpImpl+29972)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #61 pc 001ca9af  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #62 pc 001cf517  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+114)
2020-03-07 13:20:27.752 16995-16995/? A/DEBUG:     #63 pc 001e766b  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+466)
2020-03-07 13:20:29.235 3865-16997/? W/ActivityManager:   Force finishing activity com.hello.test/com.baidu.track.activity.SplashActivity
2020-03-07 13:20:29.236 3865-16997/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
2020-03-07 13:20:29.243 3865-4440/? I/BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
2020-03-07 13:20:29.277 3865-4162/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@9791681

第一次遇到这种问题,一头雾水。

近期只是在系统里面新增了一个随系统启动的new.jar,放在BOOTCLASSPATH里面。



对比:

1.刷不带new.jar的老固件测试,ok

2.刷带new.jar的debug版本固件测试,ok

3.刷带new.jar的user版本固件测试,不ok

显然,是new.jar在user模式下出了问题。



分析:

debug模式跟user模式的差别?

1.权限不一样,但是不会影响new.jar,所以,排除权限的问题。

2.user和debug模式下,env有差异?实际对比之后发现env是一样的,排除env

3.art odex优化,仔细查看/system/framework/arm里面的oat art文件,结合env里面的jar列表,终于有了重大发现,新增的new.jar并没有对应的boot-xx.oat boot-xx.art文件,看来就是这个原因了。



进一步验证:

各种百度之后,终于看到了有价值的信息,PRODUCT_BOOT_JARS对应的环境变量应该以core-oj开头,而我新增new.jar之后,变成了new.jar开头,因此导致了生成的boot-core-oj.oat有问题,只要访问到这里的内存就会出错,从而挂掉。



正确的环境变量配置:
BOOTCLASSPATH=/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.j
ar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache
-xml.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/qcom.fmradio.jar:/system/framework/tcmiface.jar:/system/framework/t
elephony-ext.jar:/system/framework/oem-services.jar:/system/framework/new.jar


错误的环境变量配置:
BOOTCLASSPATH=/system/framework/new.jar:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.j
ar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache
-xml.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/qcom.fmradio.jar:/system/framework/tcmiface.jar:/system/framework/t
elephony-ext.jar:/system/framework/oem-services.jar

很显然是PRODUCT_BOOT_JARS += new.jar的位置问题。包含PRODUCT_BOOT_JARS += new.jar的mk文件被include太靠前,导致编译之后出现在开头处。参考其他的PRODUCT_BOOT_JARS,挪动位置到其他mk里面,编译system.img验证,out/xx/system/framework/arm/目录下生成对应的oat art文件即可。

同时,在编译阶段增加检验,如果PRODUCT_BOOT_JARS不是core-oj开头,直接报错,停止编译。

diff --git a/build/core/dex_preopt_libart.mk b/build/core/dex_preopt_libart.mk
index acd4a02dd9..f678007034 100644
--- a/build/core/dex_preopt_libart.mk
+++ b/build/core/dex_preopt_libart.mk
@@ -90,6 +90,9 @@ LIBART_TARGET_BOOT_DEX_FILES := $(foreach jar,$(LIBART_TARGET_BOOT_JARS),$(call
 # is converted into to boot.art (to match the legacy assumption that boot.art
 # exists), and the rest are converted to boot-<name>.art.
 # In addition, each .art file has an associated .oat file.
+ifneq (core-oj,$(word 1,$(LIBART_TARGET_BOOT_JARS)))
+$(error "core-oj" must be the first file in <PRODUCT_BOOT_JARS> but now is "$(word 1,$(LIBART_TARGET_BOOT_JARS))")
+endif
 LIBART_TARGET_BOOT_ART_EXTRA_FILES := $(foreach jar,$(wordlist 2,999,$(LIBART_TARGET_BOOT_JARS)),boot-$(jar).art boot-$(jar).oat)
 LIBART_TARGET_BOOT_ART_EXTRA_FILES += boot.oat

欢迎客官老爷们点赞+评论。



版权声明:本文为u010725171原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。