核心转储中缺少共享库加载偏移量

问题描述 投票:0回答:1

我从该平台的跨 gdb 中的 MIPS openwrt 进程加载了核心转储。堆栈跟踪没有帮助,我试图从堆栈上的指针找出它崩溃的位置:

Program terminated with signal 6, Aborted.
#0  0x77ce2810 in ?? ()
(gdb) set sysroot rootfs/
Loaded symbols for rootfs/lib/libc.so.0

[...more lines while loading symbols...]

(gdb) info sharedlibrary
From        To          Syms Read   Shared Object Library
                        Yes (*)     rootfs/lib/libssp.so.0
                        Yes (*)     rootfs/lib/libdl.so.0
                        Yes (*)     rootfs/lib/libpthread.so.0
                        Yes (*)     rootfs/usr/lib/libstdc++.so.6
                        Yes (*)     rootfs/lib/libm.so.0
                        Yes (*)     rootfs/lib/libgcc_s.so.1
                        Yes (*)     rootfs/lib/libc.so.0
                        Yes (*)     rootfs/lib/ld-uClibc.so.0
0x77bea200  0x77c70de0  Yes (*)     rootfs/lib/libbdnc.so
                        No          /usr/lib/libssl.so
                        No          /usr/lib/libcrypto.so
                        Yes (*)     rootfs/usr/lib/libz.so
(*): Shared library is missing debugging information.

Libbdnc 是我唯一看到加载地址的一个。它是通过 dlopen() 加载的。其余的通过 -l 链接到可执行文件。它们都存在于 rootfs/ 中,但显然没有被

set sysroot
拾取。

堆栈顶部如下所示:

(gdb) x/50a $sp    
0x76fafe88: 0x427370 <stderr>   0x77d04000  0x77df70b4  0x77cf4000
0x76fafe98: 0x0 0x1 0x77e9f000  0x427370 <stderr>
0x76fafea8: 0x77d033a0  0x77df70b4  0x77df70c4  0x420000
0x76faffb8: 0x0 0x0 0x77e33160  0x0
0x76faffc8: 0x0 0x40ee98 <bdnc_init+176>    0x0 0x0

我的问题是如何找出其他指针是什么,以及无法确定大多数库的加载地址是否是堆栈值无法解析为符号的原因。

c++ gdb mips coredump openwrt
1个回答
1
投票

我的问题是...

如果您在加载核心之前设置

sysroot
,您可能会获得更好的结果。那就是:

gdb ./a.out
(gdb) set sysroot rootfs/
(gdb) core ./core
© www.soinside.com 2019 - 2024. All rights reserved.