Bug 175075 - Can't debug one machine's core files on another
Summary: Can't debug one machine's core files on another
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alexandre Oliva
QA Contact: Jay Turner
URL:
Whiteboard:
: 181463 (view as bug list)
Depends On:
Blocks: 133944 181409 190545
TreeView+ depends on / blocked
 
Reported: 2005-12-06 11:39 UTC by Bastien Nocera
Modified: 2015-01-08 00:11 UTC (History)
6 users (show)

Fixed In Version: RHBA-2006-0429
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-10 21:17:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
crash.c (264 bytes, text/plain)
2005-12-06 11:39 UTC, Bastien Nocera
no flags Details
Patch that enables gdb to compensate for prelink differences (7.89 KB, patch)
2006-01-15 21:09 UTC, Alexandre Oliva
no flags Details | Diff
Backport of the patch just posted for upstream review (15.84 KB, patch)
2006-02-08 05:49 UTC, Alexandre Oliva
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0429 0 normal SHIPPED_LIVE gdb bug fix update 2006-08-09 04:00:00 UTC

Description Bastien Nocera 2005-12-06 11:39:38 UTC
gdb-6.3.0.0-1.63

1. Compile the attached test program:
gcc -O0 -o crash -g crash.c
2. Enable core dumps
ulimit -c unlimited
3. Run the program, and generate the core
4. Launch gdb on the core:
(gdb) bt
#0  0x0045bc60 in rawmemchr () from /lib/tls/libc.so.6
#1  0x00450fd5 in _IO_str_init_static_internal () from /lib/tls/libc.so.6
#2  0x0044606d in vsscanf () from /lib/tls/libc.so.6
#3  0x0044131b in sscanf () from /lib/tls/libc.so.6
#4  0x080483d7 in Recurse (i=0) at crash.c:10
#5  0x080483e7 in Recurse (i=1) at crash.c:12
#6  0x080483e7 in Recurse (i=2) at crash.c:12
#7  0x080483e7 in Recurse (i=3) at crash.c:12
#8  0x080483e7 in Recurse (i=4) at crash.c:12
#9  0x080483e7 in Recurse (i=5) at crash.c:12
#10 0x080483e7 in Recurse (i=6) at crash.c:12
#11 0x080483e7 in Recurse (i=7) at crash.c:12
#12 0x080483e7 in Recurse (i=8) at crash.c:12
#13 0x080483e7 in Recurse (i=9) at crash.c:12
#14 0x080483e7 in Recurse (i=10) at crash.c:12
#15 0x08048430 in main () at crash.c:22

5. Copy all the files (binary and core included) on another machine with the
same glibc, gdb, and gcc installed (another RHEL4).
6. Run gdb on the other machine:
(gdb) bt
#0  0x0045bc60 in ?? ()
#1  0x00000000 in ?? ()

I compared the dependencies with "readelf -Wl", no difference apart from the
entry point and the relocatable data.

Comment 1 Bastien Nocera 2005-12-06 11:39:39 UTC
Created attachment 121901 [details]
crash.c

Comment 16 Andrew Cagney 2006-02-06 22:47:20 UTC
Alex Olivia's determined that there is a subtle but critical difference between
the two systems - prelink has altered the libraries slightly making the
relocation information different.

Ways to handle this robustly and consistently are still being considered.




Comment 17 Alexandre Oliva 2006-02-08 05:49:42 UTC
Created attachment 124352 [details]
Backport of the patch just posted for upstream review

I've improved the prelink-change detection, by taking alignment of the pages
from the binary into account.  If the dynamic section moved within its page,
assume the binary changed, otherwise adjust the offset.

Comment 18 Alexandre Oliva 2006-02-14 18:28:46 UTC
*** Bug 181463 has been marked as a duplicate of this bug. ***

Comment 21 Alexandre Oliva 2006-02-23 20:51:07 UTC
6.3.0.0-1.107..110 will have the fix when they finish building.

Comment 32 Bob Johnson 2006-04-11 15:51:07 UTC
This issue is on Red Hat Engineering's list of planned work items 
for the upcoming Red Hat Enterprise Linux 4.4 release.  Engineering 
resources have been assigned and barring unforeseen circumstances, Red 
Hat intends to include this item in the 4.4 release.

Comment 37 Red Hat Bugzilla 2006-08-10 21:17:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0429.html



Note You need to log in before you can comment on or make changes to this bug.