调试 logcat 堆栈跟踪 - 没有例程信息
Posted
技术标签:
【中文标题】调试 logcat 堆栈跟踪 - 没有例程信息【英文标题】:debugging logcat stack trace - no routine information 【发布时间】:2012-04-24 05:58:08 【问题描述】:我是调试 logcat 的新手,请耐心等待。
我的 android 应用 SIGSEGV 在共享库上。 Logcat 告诉我这个:
04-24 05:36:53.781: D/dalvikvm(1945): threadid=1: still suspended after undo (sc=1 dc=1)
04-24 05:37:00.066: A/libc(1945): Fatal signal 11 (SIGSEGV) at 0x00001a85 (code=1)
04-24 05:37:00.476: I/DEBUG(58): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-24 05:37:00.476: I/DEBUG(58): Build fingerprint: 'Android/full_mini210/mini210:4.0.3/IML74K/eng.root.20120209.191511:eng/test-keys'
04-24 05:37:00.476: I/DEBUG(58): pid: 1945, tid: 1945 >>> tiny.test2 <<<
04-24 05:37:00.476: I/DEBUG(58): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00001a85
04-24 05:37:00.476: I/DEBUG(58): r0 f6502688 r1 00000000 r2 f6502688 r3 00001a85
04-24 05:37:00.476: I/DEBUG(58): r4 00003000 r5 00000000 r6 00000039 r7 00000000
04-24 05:37:00.476: I/DEBUG(58): r8 bec795d8 r9 4b965be8 10 503cd2c1 fp bec795ec
04-24 05:37:00.476: I/DEBUG(58): ip fffffe68 sp bec79540 lr 40807077 pc 50408a56 cpsr 20000030
04-24 05:37:00.476: I/DEBUG(58): d0 474957535f5f746e d1 4e4a6874656e615f
04-24 05:37:00.476: I/DEBUG(58): d2 4b9671984b967143 d3 4b9672084b967161
04-24 05:37:00.476: I/DEBUG(58): d4 4b6fa8b92a41c200 d5 0012da7a0012da7a
04-24 05:37:00.476: I/DEBUG(58): d6 001933a8033f33c4 d7 0000008d001933a8
04-24 05:37:00.476: I/DEBUG(58): d8 0000000000000000 d9 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d10 0000000000000000 d11 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d12 0000000000000000 d13 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d14 0000000000000000 d15 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d16 00000000412adc78 d17 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d18 4146605000000000 d19 bfb1be5a93a83e1d
04-24 05:37:00.476: I/DEBUG(58): d20 3f1155e54e7e8408 d21 bebbbc6c1a570a20
04-24 05:37:00.476: I/DEBUG(58): d22 3ff0000000000000 d23 3fede16b9c24a98f
04-24 05:37:00.476: I/DEBUG(58): d24 3e66376972bea4d0 d25 3fc39a09d078c69f
04-24 05:37:00.476: I/DEBUG(58): d26 0000000000000000 d27 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d28 0000000000000000 d29 0000000000000000
04-24 05:37:00.476: I/DEBUG(58): d30 0000000000000000 d31 0000000000000000
04-24 05:37:00.480: I/DEBUG(58): scr 60000012
04-24 05:37:00.558: I/DEBUG(58): #00 pc 50408a56 /data/data/tiny.test2/lib/libcaneth.so
04-24 05:37:00.558: I/DEBUG(58): #01 lr 40807077 /system/lib/libdvm.so
04-24 05:37:00.558: I/DEBUG(58): code around pc:
04-24 05:37:00.558: I/DEBUG(58): 50408a34 9317681b 2b009b17 9a09d10a 447b4b26 .h.....+....&KD
04-24 05:37:00.558: I/DEBUG(58): 50408a44 21071c10 f7fd1c1a 2300feed e0382400 ...!.......#.$8.
04-24 05:37:00.558: I/DEBUG(58): 50408a54 681b9b17 23009318 23f0930f 1c18005b ...h...#...#[...
04-24 05:37:00.558: I/DEBUG(58): 50408a64 ee7cf02a 1c1d1c03 991b1c28 9b0a9a1a *.|.....(.......
04-24 05:37:00.558: I/DEBUG(58): 50408a74 93009c0b 9b199401 9b189302 9b0f9303 ................
04-24 05:37:00.558: I/DEBUG(58): code around lr:
04-24 05:37:00.558: I/DEBUG(58): 40807054 fd94f7ff 686a4604 46314628 f8d24643 .....Fjh(F1FCF..
04-24 05:37:00.562: I/DEBUG(58): 40807064 46227300 4a0847b8 2100a805 f7fc447a .s"F.G.J...!zD..
04-24 05:37:00.562: I/DEBUG(58): 40807074 b00afb29 81f0e8bd d5aab57f 00062cfa )............,..
04-24 05:37:00.562: I/DEBUG(58): 40807084 0004c02e 0006ad96 0004bcd4 41f0e92d ............-..A
04-24 05:37:00.562: I/DEBUG(58): 40807094 b08a4698 46054b1e 4614af05 447b460e .F...K.F...F.FD
04-24 05:37:00.562: I/DEBUG(58): memory map around addr 00001a85:
04-24 05:37:00.562: I/DEBUG(58): (no map below)
04-24 05:37:00.562: I/DEBUG(58): (no map for address)
04-24 05:37:00.562: I/DEBUG(58): 00008000-0000a000 /system/bin/app_process
04-24 05:37:00.562: I/DEBUG(58): stack:
04-24 05:37:00.562: I/DEBUG(58): bec79500 40869d12 /system/lib/libdvm.so
04-24 05:37:00.562: I/DEBUG(58): bec79504 00000004
04-24 05:37:00.562: I/DEBUG(58): bec79508 00000001
04-24 05:37:00.562: I/DEBUG(58): bec7950c 0000f2c8 [heap]
04-24 05:37:00.562: I/DEBUG(58): bec79510 40806ffd /system/lib/libdvm.so
04-24 05:37:00.562: I/DEBUG(58): bec79514 00000000
04-24 05:37:00.562: I/DEBUG(58): bec79518 00000039
04-24 05:37:00.562: I/DEBUG(58): bec7951c 00000000
04-24 05:37:00.562: I/DEBUG(58): bec79520 bec795d8 [stack]
04-24 05:37:00.562: I/DEBUG(58): bec79524 50406825 /data/data/tiny.test2/lib/libcaneth.so
04-24 05:37:00.562: I/DEBUG(58): bec79528 00000000
04-24 05:37:00.562: I/DEBUG(58): bec7952c 412adc88 /dev/ashmem/dalvik-heap (deleted)
04-24 05:37:00.562: I/DEBUG(58): bec79530 84400029
04-24 05:37:00.562: I/DEBUG(58): bec79534 0000f2c8 [heap]
04-24 05:37:00.566: I/DEBUG(58): bec79538 df0027ad
04-24 05:37:00.566: I/DEBUG(58): bec7953c 00000000
04-24 05:37:00.566: I/DEBUG(58): bec79540 00132110 [heap]
04-24 05:37:00.566: I/DEBUG(58): bec79544 00000000
04-24 05:37:00.566: I/DEBUG(58): bec79548 bec795e0 [stack]
04-24 05:37:00.566: I/DEBUG(58): bec7954c 4b969480 /dev/ashmem/dalvik-LinearAlloc (deleted)
04-24 05:37:00.566: I/DEBUG(58): bec79550 001a2530 [heap]
04-24 05:37:00.566: I/DEBUG(58): bec79554 40019ea3 /system/lib/libc.so
04-24 05:37:00.566: I/DEBUG(58): bec79558 000017c0
04-24 05:37:00.566: I/DEBUG(58): bec7955c 6b60001d
04-24 05:37:00.566: I/DEBUG(58): bec79560 6bd00019
04-24 05:37:00.566: I/DEBUG(58): bec79564 0000f2c8 [heap]
04-24 05:37:00.566: I/DEBUG(58): bec79568 00003039
04-24 05:37:00.566: I/DEBUG(58): bec7956c 00000000
04-24 05:37:00.566: I/DEBUG(58): bec79570 00000000
04-24 05:37:00.566: I/DEBUG(58): bec79574 00000000
04-24 05:37:00.566: I/DEBUG(58): bec79578 409c5460 /dev/ashmem/dalvik-heap (deleted)
04-24 05:37:00.566: I/DEBUG(58): bec7957c 000000c1
04-24 05:37:00.566: I/DEBUG(58): bec79580 00000002
04-24 05:37:00.566: I/DEBUG(58): bec79584 00000002
04-24 05:37:00.566: I/DEBUG(58): bec79588 412adc88 /dev/ashmem/dalvik-heap (deleted)
04-24 05:37:00.566: I/DEBUG(58): bec7958c 84400029
04-24 05:37:00.566: I/DEBUG(58): bec79590 4bab3d70 /dev/ashmem/dalvik-LinearAlloc (deleted)
04-24 05:37:00.566: I/DEBUG(58): bec79594 a6200025
04-24 05:37:00.566: I/DEBUG(58): bec79598 00000000
04-24 05:37:00.570: I/DEBUG(58): bec7959c 00001a85
04-24 05:37:00.570: I/DEBUG(58): bec795a0 40876c58 /system/lib/libdvm.so
04-24 05:37:00.570: I/DEBUG(58): bec795a4 00000001
04-24 05:37:00.570: I/DEBUG(58): bec795a8 000017c0
04-24 05:37:00.570: I/DEBUG(58): bec795ac 00132248 [heap]
04-24 05:37:00.570: I/DEBUG(58): bec795b0 00000000
04-24 05:37:00.570: I/DEBUG(58): bec795b4 4bbf5e70 /dev/ashmem/dalvik-LinearAlloc (deleted)
04-24 05:37:00.570: I/DEBUG(58): bec795b8 00012830 [heap]
04-24 05:37:00.570: I/DEBUG(58): bec795bc 00000003
04-24 05:37:00.570: I/DEBUG(58): bec795c0 4b965c00
04-24 05:37:00.570: I/DEBUG(58): bec795c4 407ddbf4 /system/lib/libdvm.so
04-24 05:37:00.570: I/DEBUG(58): bec795c8 79200021
04-24 05:37:00.570: I/DEBUG(58): bec795cc 00000001
04-24 05:37:00.570: I/DEBUG(58): bec795d0 00001a85
04-24 05:37:00.570: I/DEBUG(58): bec795d4 00000000
04-24 05:37:00.570: I/DEBUG(58): bec795d8 4b965be8
04-24 05:37:00.570: I/DEBUG(58): bec795dc 00000001
04-24 05:37:00.570: I/DEBUG(58): bec795e0 412aca10 /dev/ashmem/dalvik-heap (deleted)
04-24 05:37:00.570: I/DEBUG(58): bec795e4 00012840 [heap]
04-24 05:37:00.570: I/DEBUG(58): bec795e8 bec79898 [stack]
04-24 05:37:00.570: I/DEBUG(58): bec795ec 40817c33 /system/lib/libdvm.so
04-24 05:37:00.570: I/DEBUG(58): bec795f0 4b965be8
04-24 05:37:00.570: I/DEBUG(58): bec795f4 503cd2bb /data/dalvik-cache/data@app@tiny.test2-1.apk@classes.dex
04-24 05:37:00.570: I/DEBUG(58): bec795f8 50408909 /data/data/tiny.test2/lib/libcaneth.so
04-24 05:37:00.570: I/DEBUG(58): bec795fc 00012840 [heap]
04-24 05:37:00.570: I/DEBUG(58): bec79600 00000008
04-24 05:37:00.570: I/DEBUG(58): bec79604 00000000
04-24 05:37:00.570: I/DEBUG(58): bec79608 6bd00019
04-24 05:37:00.574: I/DEBUG(58): bec7960c 4c1f228a /data/dalvik-cache/system@framework@core.jar@classes.dex
04-24 05:37:00.574: I/DEBUG(58): bec79610 fffffe4c
04-24 05:37:00.574: I/DEBUG(58): bec79614 f6502688
04-24 05:37:00.574: I/DEBUG(58): bec79618 4bb9da38 /dev/ashmem/dalvik-LinearAlloc (deleted)
04-24 05:37:00.574: I/DEBUG(58): bec7961c 00000000
04-24 05:37:00.574: I/DEBUG(58): bec79620 00000000
04-24 05:37:00.574: I/DEBUG(58): bec79624 00000000
04-24 05:37:00.574: I/DEBUG(58): bec79628 00000000
04-24 05:37:00.574: I/DEBUG(58): bec7962c 00000000
04-24 05:37:00.574: I/DEBUG(58): bec79630 00156cae [heap]
04-24 05:37:00.574: I/DEBUG(58): bec79634 00156c98 [heap]
04-24 05:37:00.574: I/DEBUG(58): bec79638 4004c4d8
04-24 05:37:00.574: I/DEBUG(58): bec7963c 4004c4d8
04-24 05:37:00.574: I/DEBUG(58): bec79640 00161678 [heap]
04-24 05:37:00.574: I/DEBUG(58): bec79644 001616b0 [heap]
04-24 05:37:00.699: W/ActivityManager(189): Launch timeout has expired, giving up wake lock!
04-24 05:37:00.804: W/ActivityManager(189): Activity idle timeout for ActivityRecord41571d28 tiny.test2/.Test2Activity
通过 ndk-stack 运行它会给出
********** Crash dump: **********
Build fingerprint: 'Android/full_mini210/mini210:4.0.3/IML74K/eng.root.20120209.191511:eng/test-keys'
pid: 1945, tid: 1945 >>> tiny.test2 <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00001a85
Stack frame #00 pc 50408a56 /data/data/tiny.test2/lib/libcaneth.so: Unable to locate routine information for address 50408a56 in module ./obj/local/armeabi/libcaneth.so
addr2line 在 50408a56、408a56 或 8a56 上返回 ??
(我更改了数字,因为我读到 addr2line 需要偏移地址)。我还尝试了 libcaneth.so 在堆栈上的最后一个地址,50406825,同样的交易。
readelf 告诉我最近的地址在 dynsyms 中,我尝试导出 dynsyms 的内容,但没有地址信息。
ndk-gdb 为我提供了 SIGSEGV 的相同 pc 地址,但也没有找到函数名称或行号。鉴于没有确定的函数标签,这是否表明错误出在类变量初始化中?如何找到故障线?我可能做错了什么?
【问题讨论】:
什么解决办法,我也遇到了同样的问题 【参考方案1】:你在编译和链接调试符号吗
LOCAL_CFLAGS +=-g
LOCAL_LDLIBS :=-g
【讨论】:
以上是关于调试 logcat 堆栈跟踪 - 没有例程信息的主要内容,如果未能解决你的问题,请参考以下文章
如何从 DDMS 中的 Android 可穿戴设备获取 logcat 消息/堆栈跟踪
Unity 之 安卓堆栈跟踪和日志工具 (Android Logcat | 符号表解析Bugly捕获)
Unity 之 安卓堆栈跟踪和日志工具 (Android Logcat | 符号表解析Bugly捕获)
NullReferenceException,没有堆栈跟踪......从哪里开始?