Bug 175075

Summary: Can't debug one machine's core files on another
Product: Red Hat Enterprise Linux 4 Reporter: Bastien Nocera <bnocera>
Component: gdbAssignee: Alexandre Oliva <aoliva>
Status: CLOSED ERRATA QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: aoliva, cagney, jakub, kasal, srevivo, tao
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0429 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-10 21:17:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 133944, 181409, 190545    
Attachments:
Description Flags
crash.c
none
Patch that enables gdb to compensate for prelink differences
none
Backport of the patch just posted for upstream review none

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