- --------- beginning of crash
- 04-18 06:40:32.447 F/libc ( 1667): stack corruption detected
- 04-18 06:40:32.448 F/libc ( 1667): Fatal signal 6 (SIGABRT), code -6 in tid 1667 (system_server)
- 04-18 06:40:32.448 W/ ( 435): debuggerd: handling request: pid=1667 uid=1000 gid=1000 tid=1667
- 04-18 06:40:32.497 E/ ( 1851): debuggerd: Unable to connect to activity manager (connect failed: Connection refused)
- 04-18 06:40:32.547 F/DEBUG ( 1851): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
- 04-18 06:40:32.548 F/DEBUG ( 1851): Build fingerprint: 'Scooper/P326/P326:7.1.2/N2G47H/20221130.161004:user/test-keys'
- 04-18 06:40:32.548 F/DEBUG ( 1851): Revision: '0'
- 04-18 06:40:32.548 F/DEBUG ( 1851): ABI: 'arm64'
- 04-18 06:40:32.548 F/DEBUG ( 1851): pid: 1667, tid: 1667, name: system_server >>> system_server <<<
- 04-18 06:40:32.548 F/DEBUG ( 1851): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
- 04-18 06:40:32.552 F/DEBUG ( 1851): Abort message: 'stack corruption detected'
- 04-18 06:40:32.552 F/DEBUG ( 1851): x0 0000000000000000 x1 0000000000000683 x2 0000000000000006 x3 0000000000000008
- 04-18 06:40:32.552 F/DEBUG ( 1851): x4 0000007f61601484 x5 0080808080808080 x6 0000000000000000 x7 0000000000000010
- 04-18 06:40:32.552 F/DEBUG ( 1851): x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
- 04-18 06:40:32.552 F/DEBUG ( 1851): x12 ffffffffffffffff x13 0000000000000000 x14 0000000000000000 x15 001ab3d5be6a062b
- 04-18 06:40:32.552 F/DEBUG ( 1851): x16 0000007f80782ed0 x17 0000007f8072c81c x18 00000000ffffffff x19 0000007f83ff9b40
- 04-18 06:40:32.552 F/DEBUG ( 1851): x20 0000000000000006 x21 0000007f83ff9a98 x22 0000000000000002 x23 00000000133e8c80
- 04-18 06:40:32.552 F/DEBUG ( 1851): x24 00000000133b7318 x25 0000000012ff9d90 x26 0000000012c0ac10 x27 0000000012c08280
- 04-18 06:40:32.552 F/DEBUG ( 1851): x28 000000001334b710 x29 0000007fc7227140 x30 0000007f80729cac
- 04-18 06:40:32.552 F/DEBUG ( 1851): sp 0000007fc7227120 pc 0000007f8072c824 pstate 0000000060000000
- 04-18 06:40:32.556 F/DEBUG ( 1851): backtrace:
- 04-18 06:40:32.556 F/DEBUG ( 1851): #00 pc 000000000006b824 /system/lib64/libc.so (tgkill+8)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #01 pc 0000000000068ca8 /system/lib64/libc.so (pthread_kill+64)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #02 pc 0000000000024180 /system/lib64/libc.so (raise+24)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #03 pc 000000000001cbec /system/lib64/libc.so (abort+52)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #04 pc 000000000002118c /system/lib64/libc.so (__libc_fatal+104)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #05 pc 000000000006a6f0 /system/lib64/libc.so (__stack_chk_fail+16)
- 04-18 06:40:32.556 F/DEBUG ( 1851): #06 pc 0000000000000e90 /system/lib64/hw/bln_ctrl.default.so
- 04-18 06:40:32.556 F/DEBUG ( 1851): #07 pc 000000000002d6c8 /system/lib64/libandroid_servers.so
- 04-18 06:40:32.556 F/DEBUG ( 1851): #08 pc 000000000126e85c /system/framework/oat/arm64/services.odex (offset 0x1163000)
直接定位到 backtrace ,linux编译的终端切换到out输出路径下(因为整个机子是基于系统进行的工作,而系统是linux编译后输出到out目录下,所以在out目录下排查问题就可以了)
然后使用 addr2line 进行查看错误地址的原代码位置
- scooper@Scooper-SH-Compiler:~/workspace/ljh/sdm450/out/target/product/P326$ find | grep libandroid_servers.so
- ./obj_arm/SHARED_LIBRARIES/libandroid_servers_intermediates/LINKED/libandroid_servers.so
- 20221122.133922/SYSTEM/lib64/libandroid_servers.so
- ./symbols/system/lib64/libandroid_servers.so
- ./symbols/system/lib/libandroid_servers.so
- ./system/lib64/libandroid_servers.so
- ./system/lib/libandroid_servers.so
- scooper@Scooper-SH-Compiler:~/workspace/ljh/sdm450/out/target/product/P326$ file ./system/lib64/libandroid_servers.so
- ./system/lib64/libandroid_servers.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=de1d46d3651f1acefaa5d1a68a910260, stripped
- scooper@Scooper-SH-Compiler:~/workspace/ljh/sdm450/out/target/product/P326$ file ./symbols/system/lib64/libandroid_servers.so
- ./symbols/system/lib64/libandroid_servers.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=de1d46d3651f1acefaa5d1a68a910260, not stripped
- scooper@Scooper-SH-Compiler:~/workspace/ljh/sdm450/out/target/product/P326$ addr2line -C -f -p -i -e ./symbols/system/lib64/libandroid_servers.so 000000000002d6c8
- android::BLN_Ctrl_Init(hw_module_t const*, bln_ctrl_hw_device**) at /proc/self/cwd/frameworks/base/services/core/jni/com_android_server_IRCtrlService.cpp:77
- (inlined by) android::IRCtrl_Open(_JNIEnv*, _jobject*) at /proc/self/cwd/frameworks/base/services/core/jni/com_android_server_IRCtrlService.cpp:246
- scooper@Scooper-SH-Compiler:~/workspace/ljh/sdm450/out/target/product/P326$ addr2line -C -f -p -i -e ./system/lib64/libandroid_servers.so 000000000002d6c8
- android::register_android_server_IRCtrlService(_JNIEnv*) at ??:0
最后显示的就是报错的位置:报错文件 报错行数
一般是文件路径没有加
文件路径不对
相对地址不对
find | grep | 使用前 查看筛选文件路径 | 在out目录下 find | grep 文件名 |
file | file 查看哪个文件才是需要的 (查找文件过程中会有很多路径不同但是文件名相同的,先根据路径排除一些,剩下的就是根据file) | file 文件路径 |
addr2line | addr2line 使用方法 | addr2line -C -f -p -i -e 报错文件路径 相对地址 |
参考链接 | android系统 如何使用addr2line命令接续native backtraceAndroid系统(172)---如何使用addr2line命令解析nativebacktrace - 百度文库 | |