[Bug symtab/23270] New: GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] New: GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23270

            Bug ID: 23270
           Summary: GDB internal error: dwarf2read.c:18656:
                    internal-error: could not find partial DIE 0x1b7 in
                    cache
           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: ---

[ This might be a duplicate of PR16000 - Need better recovery from "could not
find partial DIE 0x1234 in cache" ]

[ At fd161d860f1df7140153eab4726705cc3e2727b0 "Fri Jun 8 20:17:34 2018 +0930"
"Define various symbols conditionally in shared librarie". ]

I see in the testsuite:
...
Running src/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp ...
FAIL: gdb.arch/amd64-entry-value-paramref.exp:
(build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref)
(GDB internal error)
...

In more detail:
...
(gdb) file
build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref^M
Reading symbols from
build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref.../home/vries/gdb_versions/devel/src/gdb/dwarf2read.c:18656:
internal-error: could not find partial DIE 0x1b7 in cache [from module
build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref]^M
^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL:
gdb.arch/amd64-entry-value-paramref.exp:
(build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-value-paramref)
(GDB internal error)
Resyncing due to internal error.
...

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=23270

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> I see in the testsuite:
> ...
> Running src/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp ...
> FAIL: gdb.arch/amd64-entry-value-paramref.exp:
> (build/gdb/testsuite/outputs/gdb.arch/amd64-entry-value-paramref/amd64-entry-
> value-paramref) (GDB internal error)
> ...

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.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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 <[hidden email]>:

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

commit 521894aa4bf50ca6569844af0c604ee8d5ea4b44
Author: Tom de Vries <[hidden email]>
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  <[hidden email]>

            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.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/23270] GDB internal error: dwarf2read.c:18656: internal-error: could not find partial DIE 0x1b7 in cache

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
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.