libc-2.20.so 的核心转储
Posted
技术标签:
【中文标题】libc-2.20.so 的核心转储【英文标题】:core dump at libc-2.20.so 【发布时间】:2017-11-01 09:59:14 【问题描述】:在嵌入式设备上运行我的 qt5 应用程序“LinuxClient”时,我得到一个核心转储。 我使用“gdb -c core.LinuxClient.24849.6.1509522596”来获取下面的堆栈:
Core was generated by `./LinuxClient'.
Program terminated with signal SIGABRT, Aborted.
#0 0x742e4d84 in ?? ()
(gdb) bt
#0 0x742e4d84 in ?? () 0x742e4d84 - 0x742b9000 = 0x2BD84
#1 0x742e8884 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) i proc m
Start Addr End Addr Size Offset objfile
0x8000 0x25e000 0x256000 0x0 /usr/share/qt5/app/mhclient/LinuxClient
0x266000 0x26b000 0x5000 0x256000 /usr/share/qt5/app/mhclient/LinuxClient
0x6fa16000 0x6fa19000 0x3000 0x0 /usr/lib/libxcb-util.so.1.0.0
0x6fa19000 0x6fa20000 0x7000 0x3000 /usr/lib/libxcb-util.so.1.0.0
...
...
0x74144000 0x74147000 0x3000 0x4b000 /usr/lib/libQt5PrintSupport.so.5.3.2
0x74148000 0x7418b000 0x43000 0x0 /usr/lib/libQt5OpenGL.so.5.3.2
0x7418b000 0x74192000 0x7000 0x43000 /usr/lib/libQt5OpenGL.so.5.3.2
0x74192000 0x74194000 0x2000 0x42000 /usr/lib/libQt5OpenGL.so.5.3.2
0x74194000 0x742ad000 0x119000 0x0 /usr/lib/libQt5Network.so.5.3.2
0x742ad000 0x742b4000 0x7000 0x119000 /usr/lib/libQt5Network.so.5.3.2
0x742b4000 0x742b9000 0x5000 0x118000 /usr/lib/libQt5Network.so.5.3.2
0x742b9000 0x743de000 0x125000 0x0 /lib/libc-2.20.so
0x743de000 0x743e6000 0x8000 0x125000 /lib/libc-2.20.so
0x743e6000 0x743e8000 0x2000 0x125000 /lib/libc-2.20.so
0x743e8000 0x743e9000 0x1000 0x127000 /lib/libc-2.20.so
0x743ec000 0x74408000 0x1c000 0x0 /lib/libgcc_s.so.1
0x74408000 0x7440f000 0x7000 0x1c000 /lib/libgcc_s.so.1
0x7440f000 0x74410000 0x1000 0x1b000 /lib/libgcc_s.so.1
arm-poky-linux-gnueabi-readelf -r LinuxClient ( just show the item for grep libc )
Relocation section '.rel.dyn' at offset 0x12aa4 contains 50 entries:
Offset Info Type Sym.Value Sym. Name
00269338 0002c316 R_ARM_JUMP_SLOT 0001bf70 __libc_start_main
arm-poky-linux-gnueabi-readelf -a /lib/libc-2.20.so ( just show the item code nearby __libc_start_main )
Symbol table '.dynsym' contains 2207 entries:
Num: Value Size Type Bind Vis Ndx Name
2081: 000c5f30 40 FUNC GLOBAL DEFAULT 11 tcgetpgrp@@GLIBC_2.4
2082: 000163a8 620 FUNC GLOBAL DEFAULT 11 __libc_start_main@@GLIBC_2.4
2083: 0002cf90 8 FUNC GLOBAL DEFAULT 11 __default_rt_sa_restorer@@GLIBC_PRIVATE
很多时候我使用 bt 来查找转储在 __default_rt_sa_restorer,这是什么意思? 这是否意味着转储是由 libc 而不是我的代码引起的?还是错误来自libc的交叉编译?
【问题讨论】:
【参考方案1】:这表明您没有安装与核心转储匹配的二进制文件和调试信息:
Core was generated by `./LinuxClient'.
Program terminated with signal SIGABRT, Aborted.
#0 0x742e4d84 in ?? ()
(gdb) bt
#0 0x742e4d84 in ?? () 0x742e4d84 - 0x742b9000 = 0x2BD84
#1 0x742e8884 in ?? ()
您需要在产生核心转储的环境中生成回溯(通常通过安装完全相同的分发包版本)。
【讨论】:
是的,你是对的,这是另一个问题。我的库是由yocto生成的,目前我没有使用调试信息构建库的方法。以上是关于libc-2.20.so 的核心转储的主要内容,如果未能解决你的问题,请参考以下文章