1. 程式人生 > >A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9269

A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9269

01-17 16:47:24.648 9269-9269/com.face.imageclassify A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9269 (l.imageclassify)
                            [ 01-17 16:47:24.648   396:  396 W/         ]
                            debuggerd: handling request: pid=9269 uid=10265 gid=10265 tid=9269
01-17 16:47:24.649 1843-2091/? I/AppManager: removeProcessDependency pid:9269
01-17 16:47:24.694 1843-7932/? I/DownloadState: @@@@@@@@@@@@ uid :10265 download :true
01-17 16:47:24.694 1843-7932/? I/PGServer: report state:5 event type:1 pid:0 uid:10265 pkg:null to pid: 1189
01-17 16:47:24.722 9467-9467/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-17 16:47:24.722 9467-9467/? A/DEBUG: Build fingerprint: 'HUAWEI/NXT-DL00/HWNXT:7.0/HUAWEINXT-DL00/C17B592:user/release-keys'
01-17 16:47:24.722 9467-9467/? A/DEBUG: Revision: '0'
01-17 16:47:24.722 9467-9467/? A/DEBUG: ABI: 'arm'
01-17 16:47:24.722 9467-9467/? A/DEBUG: pid: 9269, tid: 9269, name: l.imageclassify  >>> com.face.imageclassify <<<
01-17 16:47:24.722 9467-9467/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-17 16:47:24.728 9467-9467/? A/DEBUG: Abort message: 'art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: java_array == null'
01-17 16:47:24.728 9467-9467/? A/DEBUG:     r0 00000000  r1 00002435  r2 00000006  r3 00000008
01-17 16:47:24.728 9467-9467/? A/DEBUG:     r4 ee90e58c  r5 00000006  r6 ee90e534  r7 0000010c
01-17 16:47:24.728 9467-9467/? A/DEBUG:     r8 eba7d494  r9 00000000  sl ff927464  fp eba69bec
01-17 16:47:24.729 9467-9467/? A/DEBUG:     ip 0000000b  sp ff927370  lr ecb8eeb7  pc ecb91720  cpsr 600b0010
01-17 16:47:24.741 9467-9467/? A/DEBUG: backtrace:
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #00 pc 0004a720  /system/lib/libc.so (tgkill+12)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #01 pc 00047eb3  /system/lib/libc.so (pthread_kill+34)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #02 pc 0001d955  /system/lib/libc.so (raise+10)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #03 pc 000194a1  /system/lib/libc.so (__libc_android_abort+34)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #04 pc 000170e4  /system/lib/libc.so (abort+4)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #05 pc 0031b13d  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252)
01-17 16:47:24.741 9467-9467/? A/DEBUG:     #06 pc 000b4f77  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+866)
01-17 16:47:24.742 9467-9467/? A/DEBUG:     #07 pc 002393b1  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1584)
01-17 16:47:24.742 9467-9467/? A/DEBUG:     #08 pc 0023967b  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+66)
01-17 16:47:24.742 9467-9467/? A/DEBUG:     #09 pc 00282ee3  /system/lib/libart.so (_ZN3art3JNI17GetPrimitiveArrayIP12_jfloatArrayfNS_6mirror14PrimitiveArrayIfEEEEPT0_P7_JNIEnvT_Ph+550)
01-17 16:47:24.742 9467-9467/? A/DEBUG:     #10 pc 0010af93  /data/app/com.face.imageclassify-1/lib/arm/libfaceall.so (Java_com_face_androidsdk_FaceCompare_nativeCompare+22)
01-17 16:47:24.742 9467-9467/? A/DEBUG:     #11 pc 0086ae2d  /data/app/com.face.imageclassify-1/oat/arm/base.odex (offset 0x811000)
在執行程式的時候出現了上述異常,導致程式崩潰。檢視異常資訊,沒有丟擲的java異常,只有這些資訊。
檢視上述異常資訊,可以看到是libfaceall.so檔案中的FaceCompare_nativeCompare方法出了問題。

後來查到是java程式碼呼叫.so檔案裡的本地方法時,java程式碼在給本地方法傳引數時傳的值為空,導致本地方法空指標,出現了上述問題。在java程式碼往本地方法傳引數時先判斷值是否為空,問題解決。