如何在 CentOS 上安装 corosync 包的调试符号?

如何在 CentOS 上安装 corosync 包的调试符号?

我遇到了崩溃,corosync我想在 gdb 中查看。但是,目前核心转储仅向我显示这么多信息

Debug logs for core.1385 (Generated on Jul 26 10:17 BST)

[Thread debugging using libthread_db enabled]
Core was generated by `corosync -f'.
Program terminated with signal 6, Aborted.
#0 0x00007f68b2783495 in raise () from /lib64/libc.so.6
#0 0x00007f68b2783495 in raise () from /lib64/libc.so.6
#1 0x00007f68b2784c75 in abort () from /lib64/libc.so.6
#2 0x00007f68b277c60e in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007f68b277c6d0 in __assert_fail () from /lib64/libc.so.6
#4 0x00007f68b3530f2c in ?? () from /usr/lib64/libtotem_pg.so.4
#5 0x00007f68b3534eaf in ?? () from /usr/lib64/libtotem_pg.so.4
#6 0x00007f68b3535259 in ?? () from /usr/lib64/libtotem_pg.so.4
#7 0x00007f68b352f108 in rrp_deliver_fn () from /usr/lib64/libtotem_pg.so.4
#8 0x00007f68b352be2a in ?? () from /usr/lib64/libtotem_pg.so.4
#9 0x00007f68b3524482 in poll_run () from /usr/lib64/libtotem_pg.so.4
#10 0x00000000004079b6 in main ()

我想我需要安装调试信息包,corosync无论是什么libtotem_pg.so.4。这个怎么做?

答案1

通常,当您启动时,gdb它会显示一条消息,告诉您如何安装所需的调试符号。

例如:

# gdb /usr/sbin/corosync
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/corosync...Reading symbols from /usr/sbin/corosync...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install corosync-2.4.3-2.el7_5.1.x86_64
(gdb) 

请参阅提示之前的最后一行:

Missing separate debuginfos, use: debuginfo-install corosync-2.4.3-2.el7_5.1.x86_64

因此,在这种情况下,您可以通过在 shell 中(而不是在 gdb 中)运行以下命令来安装调试符号:

debuginfo-install corosync-2.4.3-2.el7_5.1.x86_64

您没有指定您使用的 CentOS 版本。以上是针对 CentOS 7 的。它在 CentOS 6 上的工作方式相同,但您不能剪切和粘贴该命令,因为库版本不同。

相关内容