This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: examining a core dump on a machine with other base addresses in shared libraries


On Wed, 27 May 2009 22:52:35 +0200, Drago Krznaric wrote:
> software (RedHat 4).

expecting RHEL (Red Hat Enterprise Linux) release 4 update <unknown>.
Red Hat Linux 4.0/4.1/4.2 is sometimes still in use but it is very old now.

IMO this looks as system specific issue more suitable for:
	https://bugzilla.redhat.com


> Does anybody know if and how this can be done?

This is a standard feature of GDB and verified now RHEL-4.8 i386 that it
really works as expect both with system gdb-6.3.0.0-1.162.el4.i386 and built
FSF GDB 6.8.


> When opening core dump with gdb-6.8 on B machine, I get something like:
> 
> warning: .dynamic section for "/usr/lib/libstdc++.so.6" is not at the expected address (wrong library or version mismatch?)

As printed by GDB LM_ADDR_CHECK() it suggests the build (=library rpm
versions) of your two machines differ.  core file cannot be debugged without
the exact build of the libraries.  Check it really matches by:
	rpm --qf '%{name}-%{version}-%{release}.%{arch}\n' -qf FILES...

build-id feature was not available for RHEL-4 so one can never be for sure but
this mismatch means something is wrong, expecting a different version/build.


> and when I do a backtrace I get something useless as:

Attached below my tests of differently prelinked libraries.


Regards,
Jan

------------------------------------------------------------------------------

$ echo -e "set debug-file-directory $PWD\nfile /bin/sleep\ncore-file ./core.18978" >1;~/redhat/gdb-6.8/gdb/gdb -x ./1
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-linux-gnu".
warning: .dynamic section for "/root/jkratoch/redhat/libc.so.6" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
Core was generated by `sleep 1h'.
Program terminated with signal 11, Segmentation fault.
[New process 18978]
#0  0x005fd7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0x005fd7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x006a7bc0 in __nanosleep_nocancel () from /root/jkratoch/redhat/libc.so.6
#2  0x0804a6c8 in xnanosleep (seconds=3600) at xnanosleep.c:169
#3  0x080490ce in main (argc=2, argv=0xbff84104) at sleep.c:166
(gdb) q
$ echo -e "set debug-file-directory $PWD\nfile /bin/sleep\ncore-file ./core.18978" >1;gdb -x ./1
GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
Copyright 2004 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 "i386-redhat-linux-gnu".
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Core was generated by `sleep 1h'.
Program terminated with signal 11, Segmentation fault.
warning: .dynamic section for "/root/jkratoch/redhat/libc.so.6" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
#0  0x005fd7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0x005fd7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x006a7bc0 in __nanosleep_nocancel () from /root/jkratoch/redhat/libc.so.6
#2  0x0804a6c8 in xnanosleep (seconds=3600) at xnanosleep.c:169
#3  0x080490ce in main (argc=2, argv=0xbff84104) at sleep.c:166
#4  0x00630df3 in __libc_start_main () from /root/jkratoch/redhat/libc.so.6
#5  0x08048cf1 in _start ()
(gdb) q


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]