public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29572] New: [gdb/symtab] read.h:298: internal-error: length: Assertion `m_length != 0' failed.
@ 2022-09-14  8:28 vries at gcc dot gnu.org
  2022-09-14  8:30 ` [Bug symtab/29572] " vries at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-14  8:28 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29572
           Summary: [gdb/symtab] read.h:298: internal-error: length:
                    Assertion `m_length != 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 != 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><a5>: Abbrev Number: 2 (DW_TAG_partial_unit)
    <a6>   DW_AT_stmt_list   : 0xe8
 <1><aa>: Abbrev Number: 3 (DW_TAG_base_type)
    <ab>   DW_AT_byte_size   : 4
    <ac>   DW_AT_encoding    : 5        (signed)
    <ad>   DW_AT_name        : myint
 <1><b3>: 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 from
.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.

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

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

end of thread, other threads:[~2023-12-06  9:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  8:28 [Bug symtab/29572] New: [gdb/symtab] read.h:298: internal-error: length: Assertion `m_length != 0' failed vries at gcc dot gnu.org
2022-09-14  8:30 ` [Bug symtab/29572] " vries at gcc dot gnu.org
2022-09-14  8:31 ` vries at gcc dot gnu.org
2022-09-14  9:52 ` vries at gcc dot gnu.org
2022-09-14  9:53 ` vries at gcc dot gnu.org
2022-09-14 12:30 ` vries at gcc dot gnu.org
2022-09-14 13:02 ` vries at gcc dot gnu.org
2022-09-14 13:50 ` vries at gcc dot gnu.org
2022-09-14 15:49 ` vries at gcc dot gnu.org
2023-07-20 12:44 ` vries at gcc dot gnu.org
2023-08-10 13:46 ` cvs-commit at gcc dot gnu.org
2023-12-06  9:29 ` cvs-commit at gcc dot gnu.org
2023-12-06  9:35 ` 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).