From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D1BAA3858435; Wed, 6 Jul 2022 14:28:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1BAA3858435 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29323] New: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed. Date: Wed, 06 Jul 2022 14:28:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2022 14:28:32 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29323 Bug ID: 29323 Summary: [gdb/symtab] read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab !=3D 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 !=3D 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 err= or) ... 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 =3D dw2_instantiate_symtab (per_cu, per_objfile, false); - gdb_assert (symtab !=3D nullptr); - if (expansion_notify !=3D NULL && symtab_was_null) + if (symtab !=3D nullptr && expansion_notify !=3D 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 symbol= s 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=3D0 DW_IDX_GNU_internal= =3D1 <5> DW_TAG_structure_type DW_IDX_type_unit=3D1 DW_IDX_GNU_internal= =3D1 ... but there's no indication that the foo and main compilation units also cont= ain those types (using aforementioned decl-with-sig-ref). --=20 You are receiving this mail because: You are on the CC list for the bug.=