From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BDD623858298; Wed, 14 Sep 2022 08:28:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDD623858298 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663144103; bh=hPYySj6R5BmBeDdG46JDt9qRVo7y2agi8tD3QSJXbOs=; h=From:To:Subject:Date:From; b=uzq3+aNC4pS5DjkNrr9JF00oClw0X0QF2o/EXmHMR4p3dsxp6S5YkoRut3Eib7UAc RSR1BvirAq8RnIlc7K5quG+F7DEOORTlA5zlQ5Q+iLRHl5uGCc96s4FmnJ3U9HIQ2G +vuQd1H1mMpYaF2CKAdDkTkSDRtd9A+2gmhJPfjQ= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29572] New: [gdb/symtab] read.h:298: internal-error: length: Assertion `m_length != 0' failed. Date: Wed, 14 Sep 2022 08:28:23 +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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29572 Bug ID: 29572 Summary: [gdb/symtab] read.h:298: internal-error: length: Assertion `m_length !=3D 0' 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: --- When running with target board cc-with-debug-names, I run into: ... FAIL: gdb.dwarf2/dw2-symtab-includes-lookup.exp: ptype myint (GDB internal error) FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: ptype foo (GDB internal error) FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: CU addr found FAIL: gdb.dwarf2/opaque-type-lookup.exp: p variable_a (GDB internal error) FAIL: gdb.dwarf2/opaque-type-lookup.exp: p variable_b (GDB internal error) FAIL: gdb.dwarf2/varval.exp: print bad_die_val1 (GDB internal error) ... Command-line reproducer of first fail: ... $ gdb -q -batch ./outputs/gdb.dwarf2/dw2-symtab-includes-lookup/dw2-symtab-includes-lookup = -ex "ptype myint" /home/vries/gdb_versions/devel/src/gdb/dwarf2/read.h:298: internal-error: length: Assertion `m_length !=3D 0' failed. ... We're trying to find (in dwarf2_find_containing_comp_unit) the containing CU for DIE 0xa5: ... Compilation Unit @ offset 0x9a: Length: 0x16 (32-bit) Version: 4 Abbrev Offset: 0x5a Pointer Size: 8 <0>: Abbrev Number: 2 (DW_TAG_partial_unit) DW_AT_stmt_list : 0xe8 <1>: Abbrev Number: 3 (DW_TAG_base_type) DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) DW_AT_name : myint <1>: Abbrev Number: 0 ... which is 0x9a, but when getting the length of the unit, it turns out to be = 0. This is a regression since commit 1c04f72368c ("[gdb/symtab] Fix assert in set_length"), which starting keeping length at 0 when reading the CU list f= rom .debug_names, and relied on a later set_length to fill in the actual length. This happens fine for CUs, but in this case it's a PU. --=20 You are receiving this mail because: You are on the CC list for the bug.=