From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 705D03858C20; Wed, 6 Jul 2022 12:17:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 705D03858C20 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed Date: Wed, 06 Jul 2022 12:17:55 +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 12:17:55 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29321 Bug ID: 29321 Summary: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type !=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 test-case gdb.dwarf2/dw2-symtab-includes.exp with target board cc-with-debug-names (same with target boards cc-with-gdb-index and readnow)= , I run into: ... (gdb) maint expand-symtab dw2-symtab-includes.h^M /home/vries/gdb_versions/devel/src/gdb/dwarf2/read.h:311: internal-error: unit_type: Assertion `m_unit_type !=3D 0' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M ----- Backtrace -----^M FAIL: gdb.dwarf2/dw2-symtab-includes.exp: maint expand-symtab dw2-symtab-includes.h (GDB internal error) ... The assert was recently added in commit 2c474c46943 ("[gdb/symtab] Add get/= set functions for per_cu->lang/unit_type"). The assert is triggered here: ... /* We're importing a C++ compilation unit with tag DW_TAG_compile_uni= t=20=20=20=20 into another compilation unit, at root level. Regard this as a hi= nt,=20=20 and ignore it. */ if (die->parent && die->parent->parent =3D=3D NULL && per_cu->unit_type () =3D=3D DW_UT_compile && per_cu->lang () =3D=3D language_cplus) return; ... We're trying to access unit_type / lang which hasn't been set yet. Normally, these are set during cooked index creation, but that's not the ca= se when using an index (or using -readnow). In other words, this lto speed optimization only worked in the normal usage case. --=20 You are receiving this mail because: You are on the CC list for the bug.=