public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
@ 2022-06-06  6:02 vries at gcc dot gnu.org
  2022-06-06  6:06 ` [Bug gdb/29227] " vries at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-06  6:02 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29227
           Summary: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file
                    warning-free
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

...
(gdb) file
/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.base/corefile/corefile^M
Reading symbols from
/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.base/corefile/corefile...^M
(gdb) core-file
/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.base/corefile/corefile.core^M
warning: core file may not match specified executable file.^M
[New LWP 12011]^M
Core was generated by
`/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.base/corefile/co'.^M
Program terminated with signal SIGABRT, Aborted.^M
#0  0xf7f22149 in __kernel_vsyscall ()^M
(gdb) FAIL: gdb.base/corefile.exp: core-file warning-free
...

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
@ 2022-06-06  6:06 ` vries at gcc dot gnu.org
  2022-06-06  7:03 ` vries at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-06  6:06 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Debugging the warning leads to:
...
(gdb) s
bfd_elf32_core_file_matches_executable_p (core_bfd=0x3661c40,
exec_bfd=0x2c11a50) at /home/vries/gdb_versions/devel/src/bfd/elfcore.h:46
46        if (core_bfd->xvec != exec_bfd->xvec)
(gdb) p core_bfd-xvec
No symbol "xvec" in current context.
(gdb) p core_bfd->xvec
$3 = (const struct bfd_target *) 0x20112a0 <i386_elf32_fbsd_vec>
(gdb) p exec_bfd->xvec
$4 = (const struct bfd_target *) 0x2010b00 <i386_elf32_vec>
(gdb) n
48            bfd_set_error (bfd_error_system_call);
(gdb) n
49            return false;
...

I wonder why is the core file is marked fbsd.

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
  2022-06-06  6:06 ` [Bug gdb/29227] " vries at gcc dot gnu.org
@ 2022-06-06  7:03 ` vries at gcc dot gnu.org
  2022-06-06 18:14 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-06  7:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
> I wonder why is the core file is marked fbsd.

That seems to have to do with priorities:
...
(gdb) p abfd->xvec
$36 = (const struct bfd_target *) 0x2010b00 <i386_elf32_vec>
(gdb) p abfd->xvec->match_priority
$37 = 1 '\001'
...
and:
...
(gdb) p abfd->xvec
$41 = (const struct bfd_target *) 0x20112a0 <i386_elf32_fbsd_vec>
(gdb) p abfd->xvec->match_priority
$42 = 0 '\000'
...
and the matching in bfd/format.c where we find that lower priorities are
better:
...
              if (match_priority < best_match)
                {
                  best_match = match_priority;
                  best_count = 0;
                }
...

Still for the exec the fbsd arch fails to match, but for the core it does.

For the exec, we hit this in elfcode.h:elf_object_p():
...
  if (ebd->elf_machine_code != EM_NONE
      && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi
      && ebd->elf_osabi != ELFOSABI_NONE)
    goto got_wrong_format_error;
...

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
  2022-06-06  6:06 ` [Bug gdb/29227] " vries at gcc dot gnu.org
  2022-06-06  7:03 ` vries at gcc dot gnu.org
@ 2022-06-06 18:14 ` vries at gcc dot gnu.org
  2022-06-07  6:38 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-06 18:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Reproduces with gdb-12-branch and gdb-11-branch.

So why didn't I see this before?

Because this is with "--enable-targets=all", and I used to build with the
opensuse gdb package equivalent
"--enable-targets=i686-suse-linux,powerpc-suse-linux,powerpc64-suse-linux,powerpc64le-suse-linux,s390-suse-linux,s390x-suse-linux,x86_64-suse-linux,arm-suse-linux,aarch64-suse-linux,m68k-suse-linux,riscv64-suse-linux,ia64-suse-linux,spu-elf
--enable-obsolete".

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-06-06 18:14 ` vries at gcc dot gnu.org
@ 2022-06-07  6:38 ` vries at gcc dot gnu.org
  2022-06-08  7:37 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-07  6:38 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhb at FreeBSD dot org

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-06-07  6:38 ` vries at gcc dot gnu.org
@ 2022-06-08  7:37 ` vries at gcc dot gnu.org
  2022-06-09  8:59 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-08  7:37 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
This copies aforementioned code from elfcode.h:elf_object_p() to
elfcore.h:elf_core_file_p():
...
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 809f6711aed..4ce81e2e383 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -272,6 +272,11 @@ elf_core_file_p (bfd *abfd)
       && ebd->elf_machine_code != EM_NONE)
     goto fail;

+  if (ebd->elf_machine_code != EM_NONE
+      && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi
+      && ebd->elf_osabi != ELFOSABI_NONE)
+    goto fail;
+
   /* Let the backend double check the format and override global
      information.  We do this before processing the program headers
      to allow the correct machine (as opposed to just the default
...
and fixes the FAIL.

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-06-08  7:37 ` vries at gcc dot gnu.org
@ 2022-06-09  8:59 ` vries at gcc dot gnu.org
  2024-01-05 15:36 ` ssbssa at sourceware dot org
  2024-01-05 15:43 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-09  8:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2022-June/189954.html

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-06-09  8:59 ` vries at gcc dot gnu.org
@ 2024-01-05 15:36 ` ssbssa at sourceware dot org
  2024-01-05 15:43 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-05 15:36 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

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

--- Comment #6 from Hannes Domani <ssbssa at sourceware dot org> ---
Wasn't this fixed by this commit?:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8ad7c8be4b5705a1138f7b2922ab7611e1d61e06

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

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

* [Bug gdb/29227] [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free
  2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-01-05 15:36 ` ssbssa at sourceware dot org
@ 2024-01-05 15:43 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-05 15:43 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Hannes Domani from comment #6)
> Wasn't this fixed by this commit?:
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;
> h=8ad7c8be4b5705a1138f7b2922ab7611e1d61e06

Yes, thanks for the reminder.

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

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

end of thread, other threads:[~2024-01-05 15:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06  6:02 [Bug gdb/29227] New: [gdb, m32] FAIL: gdb.base/corefile.exp: core-file warning-free vries at gcc dot gnu.org
2022-06-06  6:06 ` [Bug gdb/29227] " vries at gcc dot gnu.org
2022-06-06  7:03 ` vries at gcc dot gnu.org
2022-06-06 18:14 ` vries at gcc dot gnu.org
2022-06-07  6:38 ` vries at gcc dot gnu.org
2022-06-08  7:37 ` vries at gcc dot gnu.org
2022-06-09  8:59 ` vries at gcc dot gnu.org
2024-01-05 15:36 ` ssbssa at sourceware dot org
2024-01-05 15:43 ` vries at gcc dot gnu.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).