Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Drago Krznaric <drago.krznaric@spray.se>
Cc: gdb@sourceware.org
Subject: Re: examining a core dump on a machine with other base addresses 	in  shared libraries
Date: Wed, 27 May 2009 21:41:00 -0000	[thread overview]
Message-ID: <20090527214103.GA27232@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <1243457555.17311.4.camel@localhost.localdomain>

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


  reply	other threads:[~2009-05-27 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 20:52 Drago Krznaric
2009-05-27 21:41 ` Jan Kratochvil [this message]
2009-05-28  6:08   ` Drago Krznaric
2009-05-27 23:47 ` Paul Pluzhnikov
2009-05-28 20:29   ` Drago Krznaric
2009-05-31  4:51 ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090527214103.GA27232@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=drago.krznaric@spray.se \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox