Red Hat Bugzilla – Bug 175075
Can't debug one machine's core files on another
Last modified: 2015-01-07 19:11:22 EST
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:
#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:
#0 0x0045bc60 in ?? ()
#1 0x00000000 in ?? ()
I compared the dependencies with "readelf -Wl", no difference apart from the
entry point and the relocatable data.
Created attachment 121901 [details]
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.
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.
*** Bug 181463 has been marked as a duplicate of this bug. ***
18.104.22.168-1.107..110 will have the fix when they finish building.
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.
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.