Linux中的多线程应用程序中的Coredump

时间:2010-02-25 14:52:55

标签: linux gdb rhel5

我正在研究多线程应用程序。当进程转储时,它显示如下。我无法分析核心。我想知道链接库时是否有任何问题?请建议如何获取有关我的核心转储的更多信息。

利布斯:

##################################################

GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib64/libthread_db.so.1".

Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /usr/lib64/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libz.so.1
Reading symbols from /lib64/libpam.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libpam.so.0
Reading symbols from /lib64/libssl.so.6...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libssl.so.6
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libresolv.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /lib64/libnsl.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libcrypto.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypto.so.6
Reading symbols from /usr/lib64/libxml2.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxml2.so.2
Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libstdc++.so.6
Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libaudit.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libaudit.so.0
Reading symbols from /usr/lib64/libgssapi_krb5.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgssapi_krb5.so.2
Reading symbols from /usr/lib64/libkrb5.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libkrb5.so.3
Reading symbols from /lib64/libcom_err.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcom_err.so.2
Reading symbols from /usr/lib64/libk5crypto.so.3...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libk5crypto.so.3
Reading symbols from /usr/lib64/libkrb5support.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libkrb5support.so.0
Reading symbols from /lib64/libkeyutils.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libkeyutils.so.1
Reading symbols from /lib64/libselinux.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libselinux.so.1
Reading symbols from /lib64/libsepol.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libsepol.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
Reading symbols from /lib64/libnss_dns.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_dns.so.2

回溯

Core was generated by `requestprocess'                                                                  '.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000042be71 in std::string::operator= ()
(gdb) where
#0  0x000000000042be71 in std::string::operator= ()
#1  0x000000000042c559 in std::string::operator= ()
#2  0x000000000044e6df in std::ostream::operator<< ()
#3  0x000000000046f64f in std::string::substr ()
#4  0x000000000043065e in std::string::operator= ()
#5  0x0000003d2d2062e7 in start_thread () from /lib64/libpthread.so.0
#6  0x0000003d2c6ce3bd in clone () from /lib64/libc.so.6
(gdb) 

3 个答案:

答案 0 :(得分:0)

info threads

并尝试不用gdb分析coredump,但在gdb下启动你的应用程序:

gdb --args your_application with_arguments

然后

run

答案 1 :(得分:0)

默认情况下,backtrace只打印当前活动线程的堆栈,以获取所有线程的回溯,

  

线程应用所有回溯

然后你可以切换到正确的线程并进一步分析它的帧。

答案 2 :(得分:-1)

在类似Redhat的系统上(使用rpm工具安装软件),您可以试试这个:

rpm -qf file

找出安装文件的软件包。在你的情况下,

rpm -qf /usr/lib64/libstdc++.so.6

在我的情况下,这返回了libstdc++-4.1.2_20070115-0.21。现在,您需要安装包libstdc++-debug-4.1.2_20070115-0.21中的调试符号。将安装DVD放入DVD驱动器或下载软件包并安装它以获取调试符号。

如果您有openSUSE,可以使用zypper search pattern搜索名称为“pattern”的软件包。

重复其他库。