当我的一个程序运行错误时,
我使用adb logcat得到如下的错误信息。
F/libc    ( 3871): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/DEBUG   (  115): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  115): Build fingerprint: 'intel/mfld_dv10/mfld_dv10:4.0.4/IMM76D/release.20130301:eng/dev-keys'
I/DEBUG   (  115): pid: 3871, tid: 3871  >>> com.example.apis <<<
I/DEBUG   (  115): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG   (  115):  eax 00000000  ebx 5e47dbb4  ecx 00000000  edx 47900019
I/DEBUG   (  115):  esi 57a8ed84  edi bfb0eb78
I/DEBUG   (  115):  xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000 xss 0000007b
I/DEBUG   (  115):  eip 5e47a021  ebp bfb0eb98  esp bfb0eb20  flags 00010216
I/DEBUG   (  115):     #00  eip: 00003021  /data/data/com.example.apis/lib/libSampleJNIBinder.so
I/DEBUG   (  115):     #01  eip: 0007a959  /system/lib/libdvm.so (_Z16dvmCallJNIMethodPKjP6JValuePK6MethodP6Thread+0x1e9)
其中红色部分是有错误的.so文件,
eip: 00003021是错误的地址,我需要查找错误。通过网上各位大侠的办法,现在可以解决了。
我写到了我的blog里面:http://blog.csdn.net/oldmtn/article/details/8889654就是adb logcat直接输出错误的位置:
我得到的结果如下:
********** Crash dump: **********
Build fingerprint: 'intel/mfld_dv10/mfld_dv10:4.0.4/IMM76D/release.20130301:eng/dev-keys'
pid: 3871, tid: 3871  >>> com.example.apis <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
Stack frame #00  eip: 00003021  /data/data/com.example.apis/lib/libSampleJNIBinder.so: Routine Java_com_example_apis_JNI_SampleJNIBinder_JTCGetStringFromJNI in /home/huanghao/workspace_android/HHDemos/jni/SampleJNIBinder/SampleJNIBinder.cpp:35但是这种方法很麻烦
有什么更简便的办法吗?希望可以抛砖引玉。