Bug 1656088

Summary: gdb-8.2-3 fails to read Python debug symbols
Product: Red Hat Enterprise Linux 8 Reporter: Victor Stinner <vstinner>
Component: gdbAssignee: Keith Seitz <keiths>
Status: CLOSED CURRENTRELEASE QA Contact: Michal Kolar <mkolar>
Severity: unspecified Docs Contact: Vladimír Slávik <vslavik>
Priority: unspecified    
Version: 8.0CC: dsmith, gdb-bugs, jwboyer, mcermak, mkolar, ohudlick, sergiodj, vslavik
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 00:53:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Victor Stinner 2018-12-04 16:30:25 UTC
gdb-8.2-3 fails to read Python debug symbols:

# dnf install gdb -y
# dnf debuginfo-install platform-python
$ cat x.py
import time
def func(): time.sleep(60)
func()

$ gdb -args python3 x.py
...
Reading symbols from python3...Reading symbols from /usr/lib/debug/usr/libexec/platform-python3.6m-3.6.7-2.el8.x86_64.debug...done.
done.
Dwarf Error: could not find partial DIE containing offset 0x344 [in module /usr/lib/debug/usr/libexec/platform-python3.6m-3.6.7-2.el8.x86_64.debug]

(gdb) p main
Dwarf Error: could not find partial DIE containing offset 0x344 [in module /usr/lib/debug/usr/libexec/platform-python3.6m-3.6.7-2.el8.x86_64.debug]

$ rpm -q gdb
gdb-8.2-3.el8.x86_64

--

Related bugs:

* bz#1638798 (Fedora rawhide, gdb 8.2.50, OPEN)
* bz#1639242 (Fedora 29, FIXED in gdb-8.2-5)

Comment 1 Victor Stinner 2018-12-04 16:32:43 UTC
Context: "py-bt" command in gdb fails when debugging Python, see bz#1641686.

Comment 2 Sergio Durigan Junior 2018-12-18 15:37:39 UTC
As discussed with Victor on IRC, the fix for this bug has already been pushed upstream:

commit 81fbbaf96216ed88973a069e4ed25379d7421ec8 (HEAD -> master, origin/master, origin/HEAD)
Author: Sergio Durigan Junior <sergiodj>
Date:   Wed Nov 28 17:22:08 2018 -0500

    Fix dwarf2read.c:dwarf2_find_containing_comp_unit's binary search

And has also been backported to F29 GDB, as can be checked on Bug 1639242.  Therefore, the only thing needed to fix this issue is to backport the patch to RHEL8 GDB.

I know Keith has been working on a patch to synchronize RHEL8 GDB with F29 GDB, and he was just testing things to see if nothing breaks.  Once this patch is pushed and a new RHEL8 GDB is built using it, the bug should be fixed.

Comment 3 Victor Stinner 2019-01-07 11:57:44 UTC
Happy new year ;-)

"(...) the only thing needed to fix this issue is to backport the patch to RHEL8 GDB. (...) Once this patch is pushed and a new RHEL8 GDB is built using it, the bug should be fixed."

Good! Any update on that?

Comment 4 Victor Stinner 2019-01-21 09:00:11 UTC
"gdb python3" and "gdb gdb" no longer crash. gdb is able to resolve symbols, put breakpoints, where works as expected, etc.

Does gdb-8.2-5.el8.x86_64 contain the fix? Maybe just close the issue as fixed in the current release?

Comment 5 Martin Cermak 2019-01-31 20:05:40 UTC
Flipping to Modified in order to be able to attach it to the erratum.

Comment 9 Michal Kolar 2019-02-06 08:50:06 UTC
Reproduced against gdb-8.2-3.el8 and verified against gdb-8.2-5.el8 with python3-debuginfo-3.6.8-1.el8.