public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
@ 2020-07-23 14:10 ` tromey at sourceware dot org
  2020-07-23 19:22 ` cbiesinger at google dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2020-07-23 14:10 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
> The test-case contained invalid dwarf and has been fixed, so in order to
> trigger this error the test-case fix needs to be reverted.

Since it was a buggy test, should we just close this PR now?

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
  2020-07-23 14:10 ` [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache tromey at sourceware dot org
@ 2020-07-23 19:22 ` cbiesinger at google dot com
  2020-07-23 20:17 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: cbiesinger at google dot com @ 2020-07-23 19:22 UTC (permalink / raw)
  To: gdb-prs

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

Christian Biesinger <cbiesinger at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cbiesinger at google dot com

--- Comment #3 from Christian Biesinger <cbiesinger at google dot com> ---
Invalid DWARF should maybe not lead to internal errors?

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
  2020-07-23 14:10 ` [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache tromey at sourceware dot org
  2020-07-23 19:22 ` cbiesinger at google dot com
@ 2020-07-23 20:17 ` tromey at sourceware dot org
  2020-07-24  8:19 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2020-07-23 20:17 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Christian Biesinger from comment #3)
> Invalid DWARF should maybe not lead to internal errors?

Yeah, that's true.
I guess it's fine to leave open.
If no compiler has ever emitted it, then I personally
feel like it's not super important.

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-07-23 20:17 ` tromey at sourceware dot org
@ 2020-07-24  8:19 ` vries at gcc dot gnu.org
  2020-07-24  8:49 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2020-07-24  8:19 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Still reproduces:(In reply to Christian Biesinger from comment #3)
> Invalid DWARF should maybe not lead to internal errors?

Right.  And in contrast, when using -readnow, we have no internal error:
...
$ gdb -readnow amd64-entry-value-paramref 
Reading symbols from amd64-entry-value-paramref...
Expanding full symbols from amd64-entry-value-paramref...
Dwarf Error: Cannot find DIE at 0x1b7 referenced from DIE at 0x11a [in module
amd64-entry-value-paramref]
(gdb) 
...

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-07-24  8:19 ` vries at gcc dot gnu.org
@ 2020-07-24  8:49 ` vries at gcc dot gnu.org
  2020-07-24  9:04 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2020-07-24  8:49 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
The simplest thing I can think of is to turn the internal error into a
similarly-styled Dwarf error:
...
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 39ed455def..7726f193da 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -18900,9 +18900,7 @@ find_partial_die (sect_offset sect_off, int
offset_in_dwz, str
uct dwarf2_cu *cu)
     }

   if (pd == NULL)
-    internal_error (__FILE__, __LINE__,
-                   _("could not find partial DIE %s "
-                     "in cache [from module %s]\n"),
+    error (_("Dwarf Error: Cannot not find DIE at %s [from module %s]\n"),
                    sect_offset_str (sect_off), bfd_get_filename
(objfile->obfd));
   return { cu, pd };
 }
...
such that we have:
...
$ gdb amd64-entry-value-paramref 
Reading symbols from amd64-entry-value-paramref...
Dwarf Error: Cannot not find DIE at 0x1b7 [from module
amd64-entry-value-paramref]

(No debugging symbols found in amd64-entry-value-paramref)
(gdb)
...

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-07-24  8:49 ` vries at gcc dot gnu.org
@ 2020-07-24  9:04 ` vries at gcc dot gnu.org
  2020-07-24 10:53 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2020-07-24  9:04 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
So, the executable has the following CUs:
...
$ readelf -wi amd64-entry-value-paramref | grep -A4 DW_TAG_compile_unit | grep
DW_AT_name
    <20>   DW_AT_name        : ../sysdeps/x86_64/start.S
    <3f>   DW_AT_name        : init.c
    <b9>   DW_AT_name        : ../sysdeps/x86_64/crti.S
    <d8>   DW_AT_name        : gdb.arch/amd64-entry-value-paramref.cc
    <1d3>   DW_AT_name       : elf-init.c
    <38e>   DW_AT_name       : ../sysdeps/x86_64/crtn.S
...

With -readnow we manage to keep the CUs that were read before running into the
Dwarf Error:
...
$ gdb -batch -readnow amd64-entry-value-paramref -ex "maint info symtabs" |
grep "{ symtab"
Dwarf Error: Cannot find DIE at 0x1b7 referenced from DIE at 0x11a [in module
/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref]
        { symtab ../sysdeps/x86_64/crti.S ((struct symtab *) 0x3b1d470)
        { symtab init.c ((struct symtab *) 0x3ae9600)
        { symtab ../sysdeps/x86_64/start.S ((struct symtab *) 0x3ae9350)
$
...

And without -readnow, we have no info at all:
...
$ gdb -batch amd64-entry-value-paramref -ex "maint info symtabs" | grep "{
psymtab"
Dwarf Error: Cannot not find DIE at 0x1b7 [from module
/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref]
$
...

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2020-07-24  9:04 ` vries at gcc dot gnu.org
@ 2020-07-24 10:53 ` vries at gcc dot gnu.org
  2020-08-04  9:16 ` cvs-commit at gcc dot gnu.org
  2020-08-04  9:18 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2020-07-24 10:53 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
submitted: https://sourceware.org/pipermail/gdb-patches/2020-July/170831.html

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2020-07-24 10:53 ` vries at gcc dot gnu.org
@ 2020-08-04  9:16 ` cvs-commit at gcc dot gnu.org
  2020-08-04  9:18 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-04  9:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=521894aa4bf50ca6569844af0c604ee8d5ea4b44

commit 521894aa4bf50ca6569844af0c604ee8d5ea4b44
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Aug 4 11:16:37 2020 +0200

    [gdb/symtab] Handle invalid partial DIE reference

    When reverting commit 9cfd2b89bd "[gdb/testsuite] Fix
    gdb.arch/amd64-entry-value-paramref.S", we run into an internal-error:
    ...
    (gdb) file amd64-entry-value-paramref^M
    Reading symbols from amd64-entry-value-paramref...^M
    src/gdb/dwarf2/read.c:18903: internal-error: could not find partial DIE
      0x1b7 in cache [from module amd64-entry-value-paramref]^M

    A problem internal to GDB has been detected,^M
    further debugging may prove unreliable.^M
    ...
    because of invalid dwarf.

    In contrast, when using -readnow, we have:
    ...
    (gdb) file -readnow amd64-entry-value-paramref
    Reading symbols from amd64-entry-value-paramref...
    Expanding full symbols from amd64-entry-value-paramref...
    Dwarf Error: Cannot find DIE at 0x1b7 referenced from DIE at 0x11a \
      [in module amd64-entry-value-paramref]
    (gdb)
    ...

    Change the internal error into a Dwarf Error, such that we have:
    ...
    (gdb) file amd64-entry-value-paramref^M
    Reading symbols from amd64-entry-value-paramref...^M
    Dwarf Error: Cannot not find DIE at 0x1b7 \
      [from module amd64-entry-value-paramref]^M
    ^M
    (No debugging symbols found in amd64-entry-value-paramref)^M
    (gdb)
    ...

    Build and tested on x86_64-linux.

    gdb/ChangeLog:

    2020-08-04  Tom de Vries  <tdevries@suse.de>

            PR symtab/23270
            * dwarf2/read.c (find_partial_die): Change internal error into
Dwarf
            Error.

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

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

* [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache
       [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2020-08-04  9:16 ` cvs-commit at gcc dot gnu.org
@ 2020-08-04  9:18 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2020-08-04  9:18 UTC (permalink / raw)
  To: gdb-prs

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

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

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

--- Comment #10 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch committed, marking resolved-fixed.

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

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

end of thread, other threads:[~2020-08-04  9:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23270-4717@http.sourceware.org/bugzilla/>
2020-07-23 14:10 ` [Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache tromey at sourceware dot org
2020-07-23 19:22 ` cbiesinger at google dot com
2020-07-23 20:17 ` tromey at sourceware dot org
2020-07-24  8:19 ` vries at gcc dot gnu.org
2020-07-24  8:49 ` vries at gcc dot gnu.org
2020-07-24  9:04 ` vries at gcc dot gnu.org
2020-07-24 10:53 ` vries at gcc dot gnu.org
2020-08-04  9:16 ` cvs-commit at gcc dot gnu.org
2020-08-04  9:18 ` 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).