From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 421563851C0D; Tue, 19 Jul 2022 16:50:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 421563851C0D From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29381] [gdb, debug-types, debug-names] read.h:309: internal-error: set_length: Assertion `m_length == length' failed. Date: Tue, 19 Jul 2022 16:50:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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: Tue, 19 Jul 2022 16:50:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29381 --- Comment #6 from Tom de Vries --- (In reply to Tom de Vries from comment #1) > This addresses problem 2, both for .debug_names and .gdb_index: > ... > diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c > index bcd01107377..3b4409fa8ca 100644 > --- a/gdb/dwarf2/read.c > +++ b/gdb/dwarf2/read.c > @@ -2696,7 +2696,10 @@ dwarf2_read_gdb_index > /* We can only handle a single .debug_types when we have an > index. */ > if (per_bfd->types.size () !=3D 1) > - return 0; > + { > + per_bfd->all_comp_units.clear (); > + return 0; > + } >=20=20 > dwarf2_section_info *section =3D &per_bfd->types[0]; >=20=20 > @@ -4701,7 +4704,10 @@ dwarf2_read_debug_names (dwarf2_per_objfile > *per_objfile) >=20 > /* We can only handle a single .debug_types when we have an > index. */ > if (per_bfd->types.size () !=3D 1) > - return false; > + { > + per_bfd->all_comp_units.clear (); > + return false; > + } >=20=20 > dwarf2_section_info *section =3D &per_bfd->types[0]; >=20=20 > @@ -7206,6 +7212,7 @@ static void > create_all_comp_units (dwarf2_per_objfile *per_objfile) > { > htab_up types_htab; > + gdb_assert (per_objfile->per_bfd->all_comp_units.empty ()); >=20=20 > read_comp_units_from_section (per_objfile, &per_objfile->per_bfd->info, > &per_objfile->per_bfd->abbrev, 0, > ... >=20 > Also adds an assert to detect the problem asap. A similar assert is alre= ady > present in create_cus_from_index and create_cus_from_debug_names. https://sourceware.org/pipermail/gdb-patches/2022-July/190891.html --=20 You are receiving this mail because: You are on the CC list for the bug.=