[gdb 0005232]: gdb can't read core file

Mantis Bug Tracker via bug-notifications bug-notifications at lists.opencsw.org
Sat Sep 5 11:42:07 CEST 2015


A NOTE has been added to this issue. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=5232 
====================================================================== 
Reported By:                hjb
Assigned To:                pfelecan
====================================================================== 
Project:                    gdb
Issue ID:                   5232
Category:                   regular use
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             2015-02-18 09:38 CET
Last Modified:              2015-09-05 11:42 CEST
====================================================================== 
Summary:                    gdb can't read core file
Description: 
The provided gdb isn't able to read core files. Here's an example:

root at ulysses# echo $BASH
/usr/bin/bash

root at ulysses# /usr/bin/gcore $$
gcore: core.20121 dumped

root at ulysses# file core.20121 
core.20121:     ELF 32-bit MSB core file SPARC Version 1, from 'bash'

root at ulysses# /opt/csw/bin/gdb /usr/bin/bash core.20121 
GNU gdb (GDB) 7.7
Copyright (C) 2014 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 "sparc-sun-solaris2.10".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/bash...(no debugging symbols found)...done.

warning: Couldn't find general-purpose registers in core file.

warning: Wrong size fpregset in core file.
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Core was generated by `-bash'.

warning: Couldn't find general-purpose registers in core file.

warning: Wrong size fpregset in core file.
PC not available
#-1 <unavailable> in ?? ()
(gdb)


Let's compare that with this really old gdb i've got from sunfreeware years
ago, iirc:

root at ulysses# ./gdb /usr/bin/bash core.20121
GNU gdb 6.2.1
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 "sparc-sun-solaris2.10"...(no debugging symbols
found)...
Core was generated by `-bash'.
Reading symbols from /lib/libcurses.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libcurses.so.1
Reading symbols from /lib/libsocket.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libnsl.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libdl.so.1...
warning: Lowest section in /lib/libdl.so.1 is .hash at 000000b4
(no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.1
Reading symbols from /lib/libc.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /platform/sun4v/lib/libc_psr.so.1...(no debugging
symbols found)...done.
Loaded symbols for /platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr.so.1
https://www.opencsw.org/mantis/view.php?id=0  0x00000000 in ?? ()
(gdb)



====================================================================== 

---------------------------------------------------------------------- 
 (0011049) pfelecan (manager) - 2015-09-05 11:42
 https://www.opencsw.org/mantis/view.php?id=5232#c11049 
---------------------------------------------------------------------- 
The issue manifests itself on x86 platforms, in the 64 bit variant; on 32
bit variant it works correctly:

32 bit:

/opt/csw/bin/pentium_pro/gdb tgdb core
GNU gdb (GDB) 7.10
[..]
Reading symbols from tgdb...done.
[New LWP 1]
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Core was generated by `./tgdb core'.
Program terminated with signal SIGABRT, Aborted.
https://www.opencsw.org/mantis/view.php?id=0  0xfeefc0b5 in _lwp_kill () from
/lib/libc.so.1
[Current thread is 2 (Thread 1 (LWP 1))]
(gdb) bt
https://www.opencsw.org/mantis/view.php?id=0  0xfeefc0b5 in _lwp_kill () from
/lib/libc.so.1
https://www.opencsw.org/mantis/view.php?id=1  0xfeef6f39 in thr_kill () from
/lib/libc.so.1
https://www.opencsw.org/mantis/view.php?id=2  0xfeea3603 in raise () from
/lib/libc.so.1
https://www.opencsw.org/mantis/view.php?id=3  0xfee82961 in abort () from
/lib/libc.so.1
https://www.opencsw.org/mantis/view.php?id=4  0x08050c46 in main (argc=2,
argv=0x8047c54 ",}\004\b3}\004\b") at
tgdb.c:9

64 bit

/opt/csw/bin/amd64/gdb tgdb core
Exception caught while booting Guile.
Error in function "make_objcode_from_file":
bad header on object file: "GOOF----LE-4-2.0"
/opt/csw/bin/amd64/gdb: warning: Could not complete Guile gdb module
initialization from:
/opt/csw/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 7.10
Copyright (C) 2015 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 "i386-pc-solaris2.10".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tgdb...done.

warning: Couldn't find general-purpose registers in core file.
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Core was generated by `./tgdb core'.

warning: Couldn't find general-purpose registers in core file.
https://www.opencsw.org/mantis/view.php?id=0  <unavailable> in ?? ()
[Current thread is 1 (process 1    )]
(gdb) bt
https://www.opencsw.org/mantis/view.php?id=0  <unavailable> in ?? ()
Backtrace stopped: not enough registers or memory available to unwind
further

in addition, there is a Guile issue; nominal given that there is no robust
64 bit variant for it in our stack.

I suppose that on SPARC we have the same issue.



More information about the bug-notifications mailing list