From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9E0013858287; Sun, 7 Aug 2022 06:59:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E0013858287 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29453] New: [gdb/symtab] read.h:309: internal-error: set_length: Assertion `m_length == length' failed Date: Sun, 07 Aug 2022 06:59:06 +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: Sun, 07 Aug 2022 06:59:06 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29453 Bug ID: 29453 Summary: [gdb/symtab] read.h:309: internal-error: set_length: Assertion `m_length =3D=3D length' 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 this change: ... diff --git a/gdb/testsuite/gdb.dwarf2/debug-names.exp b/gdb/testsuite/gdb.dwarf2/debug-names.exp index 0af5a93bea8..f82e53d5cba 100644 --- a/gdb/testsuite/gdb.dwarf2/debug-names.exp +++ b/gdb/testsuite/gdb.dwarf2/debug-names.exp @@ -29,7 +29,7 @@ set func_info_vars \ set asm_file [standard_output_file $srcfile2] Dwarf::assemble { filename $asm_file - add_dummy_cus 0 + add_dummy_cus 1 } { global func_info_vars foreach var $func_info_vars { ... we run into: ... (gdb) break _start^M /home/vries/gdb_versions/devel/src/gdb/dwarf2/read.h:309: internal-error: set_length: Assertion `m_length =3D=3D length' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M ----- Backtrace -----^M FAIL: gdb.dwarf2/debug-names.exp: gdb_breakpoint: set breakpoint at _start = (GDB internal error) ... There are 3 CUs: ... $ readelf -wi outputs/gdb.dwarf2/debug-names/debug-names | grep @ Compilation Unit @ offset 0x0: Compilation Unit @ offset 0xb: Compilation Unit @ offset 0x38: ... but the CU list in .debug_names only contains one: ... Contents of the .debug_names section: Version 5 Augmentation string: 47 44 42 00 ("GDB") CU table: [ 0] 0xb TU table: ... The length of the CU at 0xb is calculated in create_cus_from_debug_names_li= st as if the CU at 0x38 is also a part of it. Then when doing full expansion, the actual CU header is read, and we find o= ut the size is different: ... #6 0x0000000000718b2f in dwarf2_per_cu_data::set_length (this=3D0x2cdc870, length=3D45, strict_p=3Dtrue) at read.h:309 309 gdb_assert (m_length =3D=3D length); (gdb) p m_length $1 =3D 56 (gdb) p length $2 =3D 45 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=