public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.
@ 2022-07-06 14:28 vries at gcc dot gnu.org
  2022-07-06 14:28 ` [Bug symtab/29323] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-06 14:28 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29323
           Summary: [gdb/symtab] read.c:3963: internal-error:
                    dw2_expand_symtabs_matching_one: Assertion `symtab !=
                    nullptr' failed.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With test-case gdb.dwarf2/struct-with-sig.exp and target board
cc-with-debug-names I run into:
...
(gdb) ptype struct s^M
/home/vries/gdb_versions/devel/src/gdb/dwarf2/read.c:3963: internal-error:
dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
----- Backtrace -----^M
FAIL: gdb.dwarf2/struct-with-sig.exp: struct s with int i (GDB internal error)
...

This is easily enough fixed by:
...
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 017cde0dcd9..97be0aaa0db 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -3960,9 +3960,8 @@ dw2_expand_symtabs_matching_one

       compunit_symtab *symtab
        = dw2_instantiate_symtab (per_cu, per_objfile, false);
-      gdb_assert (symtab != nullptr);

-      if (expansion_notify != NULL && symtab_was_null)
+      if (symtab != nullptr && expansion_notify != NULL && symtab_was_null)

        return expansion_notify (symtab);
     }
   return true;
...

Still, we're trying to print struct s, in the context of main, which has a
struct s decl with sig reference to a struct s in a TU.

So why are we're trying to instantiate the dummy CU at offset 0x9a:
...
  Compilation Unit @ offset 0x8f:
   Length:        0x7 (32-bit)
   Version:       4
   Abbrev Offset: 0x59
   Pointer Size:  8
  Compilation Unit @ offset 0x9a:
...
which contains no symbols and is indeed not listed as containing any symbols in
the .debug_names index?

Is this because the index is missing information?  That is, it has:
...
[ 15] #0002b618 s:
        <5> DW_TAG_structure_type DW_IDX_type_unit=0 DW_IDX_GNU_internal=1
        <5> DW_TAG_structure_type DW_IDX_type_unit=1 DW_IDX_GNU_internal=1
...
but there's no indication that the foo and main compilation units also contain
those types (using aforementioned decl-with-sig-ref).

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

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

* [Bug symtab/29323] [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.
  2022-07-06 14:28 [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed vries at gcc dot gnu.org
@ 2022-07-06 14:28 ` vries at gcc dot gnu.org
  2022-07-08  7:39 ` vries at gcc dot gnu.org
  2022-07-12 12:22 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-06 14:28 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca,
                   |                            |tromey at sourceware dot org

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

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

* [Bug symtab/29323] [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.
  2022-07-06 14:28 [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed vries at gcc dot gnu.org
  2022-07-06 14:28 ` [Bug symtab/29323] " vries at gcc dot gnu.org
@ 2022-07-08  7:39 ` vries at gcc dot gnu.org
  2022-07-12 12:22 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-08  7:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
No longer fails with the tentative fix for PR29334, so probably a duplicate.

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

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

* [Bug symtab/29323] [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.
  2022-07-06 14:28 [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed vries at gcc dot gnu.org
  2022-07-06 14:28 ` [Bug symtab/29323] " vries at gcc dot gnu.org
  2022-07-08  7:39 ` vries at gcc dot gnu.org
@ 2022-07-12 12:22 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-12 12:22 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
No longer fails on master, marking as duplicate.

*** This bug has been marked as a duplicate of bug 29334 ***

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

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

end of thread, other threads:[~2022-07-12 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 14:28 [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed vries at gcc dot gnu.org
2022-07-06 14:28 ` [Bug symtab/29323] " vries at gcc dot gnu.org
2022-07-08  7:39 ` vries at gcc dot gnu.org
2022-07-12 12:22 ` 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).