This is the mail archive of the gdb-prs@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]

corefiles/2349: gdb 6.7 can't read gcore file for 32-bit processes on x86_64


>Number:         2349
>Category:       corefiles
>Synopsis:       gdb 6.7 can't read gcore file for 32-bit processes on x86_64
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 26 21:08:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Paul M. Dubuc
>Release:        6.7
>Organization:
>Environment:
 uname -a
Linux mrldev32 2.6.9-42.0.10.ELlargesmp #1 SMP Fri Feb 16 17:25:40 EST 2007 x86_64 GNU/Linux

cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
>Description:
I build both a 32 and a 64 bit version of gdb because we run both kinds of processes.  (I'm not sure if this should be necessary, but I think it seemed to be at one time.)  Attaching to a 32-bit process and using gcore to get a core image results in an image file that gdb can't read.  This is not a problem for the 64-bit gdb with 64-bit processes.
>How-To-Repeat:
 cat loop.c
main()
{
    while(1) { sleep(10); }
}

gcc -m32 -g loop.c -o a.out32

file a.out32
a.out32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

./a.out32 &

ps
  PID TTY          TIME CMD
45639 pts/28   00:00:00 ksh
6223 pts/28   00:00:00 a.out32
24575 pts/28   00:00:00 ps

gdb32
GNU gdb 6.7
Copyright (C) 2007 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-redhat-linux".
(gdb) attach 6223
Attaching to process 6223
Reading symbols from /home/pmd25/a.out32...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
warning: .dynamic section for "/lib/tls/libc.so.6" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/lib/ld-linux.so.2" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xffffe410 in __kernel_vsyscall ()
(gdb) where
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x00a93b60 in __nanosleep_nocancel () from /lib/tls/libc.so.6
#2  0x00a9398c in sleep () from /lib/tls/libc.so.6
#3  0x08048390 in main () at loop.c:3
(gdb) gcore
Saved corefile core.6223
(gdb) q
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/pmd25/a.out32, process 6223
mrldev31:/home/pmd25> 2.6.9/x86_64/bin/gdb32 ./a.out32 ./core.6223           <
GNU gdb 6.7
Copyright (C) 2007 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-redhat-linux"...
Using host libthread_db library "/lib/tls/libthread_db.so.1".

warning: Can't read pathname for load map: Input/output error.

warning: .dynamic section for "/lib/tls/libc.so.6" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations

warning: .dynamic section for "/lib/ld-linux.so.2" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Failed to read a valid object file image from memory.
Core was generated by `/home/pmd25/a.out32'.
#0  0xffffe410 in ?? ()
(gdb) where
#0  0xffffe410 in ?? ()
#1  0xffffd6f8 in ?? ()
#2  0x00b2fff4 in ?? () from /lib/tls/libc.so.6
#3  0xffffd554 in ?? ()
#4  0x00a93b60 in __nanosleep_nocancel () from /lib/tls/libc.so.6
#5  0x00a9398c in sleep () from /lib/tls/libc.so.6
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) q
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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