public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug corefiles/30273] New: Regression - "Core file format not supported"
@ 2023-03-25  2:31 fthain@linux-m68k.org
  2023-03-25 17:10 ` [Bug corefiles/30273] " tromey at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fthain@linux-m68k.org @ 2023-03-25  2:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30273

            Bug ID: 30273
           Summary: Regression - "Core file format not supported"
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: fthain@linux-m68k.org
  Target Milestone: ---
              Host: m68k-linux-gnu
            Target: m68k-linux-gnu
             Build: m68k-linux-gnu

Created attachment 14780
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14780&action=edit
Sample core dump

I'm unable to open a core file with recent versions of gdb. The problem showed
up in Debian's gdb 13.1 build and I then reproduced the same failure in the
14.0.50.20230318 snapshot.

The core file itself (attached) appears to be fine as I was able to open it
with a previous gdb release (Gentoo vanilla 10.2).

I did a little investigation and found that
gdbarch->iterate_over_regset_sections == NULL for some reason. But that's as
far as I got. Please see,
https://lists.debian.org/debian-68k/2023/03/msg00012.html

# 
# /opt/gdb-14.0.50.20230318/bin/gdb --core core.0
GNU gdb (GDB) 14.0.50.20230318-git
Copyright (C) 2023 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 "m68k-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
"/root/core.0": Core file format not supported
(gdb) 
(gdb) quit
# /opt/gdb-14.0.50.20230318/bin/gdb --configuration
This GDB was configured as follows:
   configure --host=m68k-unknown-linux-gnu --target=m68k-unknown-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/opt/gdb-14.0.50.20230318/share/gdb
(relocatable)
             --with-jit-reader-dir=/opt/gdb-14.0.50.20230318/lib/gdb
(relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-babeltrace
             --without-intel-pt
             --with-xxhash
             --without-python
             --without-python-libdir
             --with-debuginfod
             --with-curses
             --without-guile
             --without-amd-dbgapi
             --disable-source-highlight
             --enable-threading
             --enable-tui
             --with-separate-debug-dir=/usr/lib/debug

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)


# gdb --core core.0
GNU gdb (Debian 13.1-2) 13.1
Copyright (C) 2023 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 "m68k-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
"/root/core.0": Core file format not supported
(gdb) quit
# 
# gdb --configuration
This GDB was configured as follows:
   configure --host=m68k-linux-gnu --target=m68k-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-babeltrace
             --without-intel-pt
             --with-mpfr
             --with-xxhash
             --with-python=/usr (relocatable)
             --with-python-libdir=/usr/lib (relocatable)
             --with-debuginfod
             --without-guile
             --enable-source-highlight
             --enable-threading
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit
             --with-system-gdbinit-dir=/etc/gdb/gdbinit.d

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

# gcc --version
gcc (Debian 12.2.0-12) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug corefiles/30273] Regression - "Core file format not supported"
  2023-03-25  2:31 [Bug corefiles/30273] New: Regression - "Core file format not supported" fthain@linux-m68k.org
@ 2023-03-25 17:10 ` tromey at sourceware dot org
  2023-03-25 17:20 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-03-25 17:10 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30273

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This is probably a regression due to this patch:

commit 3eba3a011a89c75c10bd1860eee4589e65697165
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Sep 14 08:30:10 2020 -0600

    Various m68k fixes for gdb


When I debug gdb I see it decides this core file is
GDB_OSABI_SVR4, not GDB_OSABI_LINUX.  This happens
because m68k_osabi_sniffer takes this branch:

  if (elfosabi == ELFOSABI_NONE)
    return GDB_OSABI_SVR4;

From elf/common.h:

#define ELFOSABI_NONE         0 /* UNIX System V ABI */
#define ELFOSABI_HPUX         1 /* HP-UX operating system */
#define ELFOSABI_NETBSD       2 /* NetBSD */
#define ELFOSABI_GNU          3 /* GNU */
#define ELFOSABI_LINUX        3 /* Alias for ELFOSABI_GNU */


So I guess one question is why this core file isn't marked
as ELFOSABI_LINUX.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug corefiles/30273] Regression - "Core file format not supported"
  2023-03-25  2:31 [Bug corefiles/30273] New: Regression - "Core file format not supported" fthain@linux-m68k.org
  2023-03-25 17:10 ` [Bug corefiles/30273] " tromey at sourceware dot org
@ 2023-03-25 17:20 ` tromey at sourceware dot org
  2023-03-25 17:31 ` tromey at sourceware dot org
  2023-04-21  5:36 ` fthain@linux-m68k.org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-03-25 17:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30273

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-03-25
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
I think using "--target=m68k-linux-gnu" sets
gdb_osabi=GDB_OSABI_LINUX (in configure.tgt)
and so that explains why this worked before the
osabi sniffer was added.

I wonder if the m68k sniffer could use
generic_elf_osabi_sniff_abi_tag_sections to detect
that this is a Linux core file.
I do see:

prentzel. objdump -x /tmp/core.0 |grep linux
  1 .note.linuxcore.siginfo/1845559296 00000080  00000000  00000000  00000388 
2**2
  2 .note.linuxcore.siginfo 00000080  00000000  00000000  00000388  2**2
  4 .note.linuxcore.file/1845559296 00000192  00000000  00000000  000004b8 
2**2
  5 .note.linuxcore.file 00000192  00000000  00000000  000004b8  2**2

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug corefiles/30273] Regression - "Core file format not supported"
  2023-03-25  2:31 [Bug corefiles/30273] New: Regression - "Core file format not supported" fthain@linux-m68k.org
  2023-03-25 17:10 ` [Bug corefiles/30273] " tromey at sourceware dot org
  2023-03-25 17:20 ` tromey at sourceware dot org
@ 2023-03-25 17:31 ` tromey at sourceware dot org
  2023-04-21  5:36 ` fthain@linux-m68k.org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-03-25 17:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30273

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
> generic_elf_osabi_sniff_abi_tag_sections

Nope, that didn't work, that function looks for specific notes.
Still, for BSD it does:

  if (strcmp (name, ".note.netbsdcore.procinfo") == 0)

i.e., just checking the section name.  So maybe this could be
done for the above as well.  I just wonder if it's really ok.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug corefiles/30273] Regression - "Core file format not supported"
  2023-03-25  2:31 [Bug corefiles/30273] New: Regression - "Core file format not supported" fthain@linux-m68k.org
                   ` (2 preceding siblings ...)
  2023-03-25 17:31 ` tromey at sourceware dot org
@ 2023-04-21  5:36 ` fthain@linux-m68k.org
  3 siblings, 0 replies; 5+ messages in thread
From: fthain@linux-m68k.org @ 2023-04-21  5:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30273

--- Comment #4 from Finn Thain <fthain@linux-m68k.org> ---
Here is a workaround for this issue.

(gdb) set osabi GNU/Linux
(gdb) core core.0
[New LWP 366]
Core was generated by `/bin/sh /etc/init.d/mountkernfs.sh reload'.
Program terminated with signal SIGABRT, Aborted.
#0  0xc00a7034 in ?? ()
(gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-21  5:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25  2:31 [Bug corefiles/30273] New: Regression - "Core file format not supported" fthain@linux-m68k.org
2023-03-25 17:10 ` [Bug corefiles/30273] " tromey at sourceware dot org
2023-03-25 17:20 ` tromey at sourceware dot org
2023-03-25 17:31 ` tromey at sourceware dot org
2023-04-21  5:36 ` fthain@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).