public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed
@ 2022-07-06 12:17 vries at gcc dot gnu.org
  2022-07-06 12:45 ` [Bug symtab/29321] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-06 12:17 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29321

            Bug ID: 29321
           Summary: [gdb] read.h:311: internal-error: unit_type: Assertion
                    `m_unit_type != 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 != 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_unit    
         into another compilation unit, at root level.  Regard this as a hint,  
         and ignore it.  */
      if (die->parent && die->parent->parent == NULL
          && per_cu->unit_type () == DW_UT_compile
          && per_cu->lang () == 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 case
when using an index (or using -readnow).

In other words, this lto speed optimization only worked in the normal usage
case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/29321] [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed
  2022-07-06 12:17 [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed vries at gcc dot gnu.org
@ 2022-07-06 12:45 ` vries at gcc dot gnu.org
  2022-07-06 16:13 ` vries at gcc dot gnu.org
  2022-07-08 13:58 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-06 12:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29321

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14196
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14196&action=edit
Tentative patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/29321] [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed
  2022-07-06 12:17 [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed vries at gcc dot gnu.org
  2022-07-06 12:45 ` [Bug symtab/29321] " vries at gcc dot gnu.org
@ 2022-07-06 16:13 ` vries at gcc dot gnu.org
  2022-07-08 13:58 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-06 16:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29321

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
On openSUSE Tumbleweed, with gcc-12 defaulting to dwarf-5, I run into this PR
with native:
...
FAIL: gdb.dwarf2/count.exp: runto: run to main (GDB internal error)
FAIL: gdb.dwarf2/implptrconst.exp: runto: run to main (GDB internal error)
FAIL: gdb.dwarf2/implptrpiece.exp: runto: run to main (GDB internal error)
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/29321] [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed
  2022-07-06 12:17 [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed vries at gcc dot gnu.org
  2022-07-06 12:45 ` [Bug symtab/29321] " vries at gcc dot gnu.org
  2022-07-06 16:13 ` vries at gcc dot gnu.org
@ 2022-07-08 13:58 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-08 13:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29321

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |13.1

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=8728fb3385c136b05dc16fb6664a57028acd0d73

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-08 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 12:17 [Bug symtab/29321] New: [gdb] read.h:311: internal-error: unit_type: Assertion `m_unit_type != 0' failed vries at gcc dot gnu.org
2022-07-06 12:45 ` [Bug symtab/29321] " vries at gcc dot gnu.org
2022-07-06 16:13 ` vries at gcc dot gnu.org
2022-07-08 13:58 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).