Hide Forgot
+++ This bug was initially created as a clone of Bug #1613614 +++ Description of problem: py-bt is broken, results in exception: (gdb) py-bt Traceback (most recent call first): (frame information optimized out) Python Exception <class 'TypeError'> 'FakeRepr' object is not subscriptable: Error occurred in Python command: 'FakeRepr' object is not subscriptable It worked fine in a recent version before that. Version-Release number of selected component (if applicable): python3: python3-3.6.6-1.fc28.src.rpm gdb: 8.1-25.fc28 How reproducible: 100% Steps to Reproduce: 1. Open gdb 2. Attach to python3 process 3. Type py-bt Actual results: doesn't work, gives error Python Exception <class 'TypeError'> 'FakeRepr' object is not subscriptable Expected results: works Additional info: --- Additional comment from Victor Stinner on 2018-10-15 06:59:57 EDT --- I reproduced the issue: $ sudo dnf debuginfo-install python3 $ cat x.py import time def dodo(): print("dodo") time.sleep(3600) dodo() vstinner@apu$ gdb -args python3 x.py GNU gdb (GDB) Fedora 8.1.1-3.fc28 (...) Reading symbols from python3...Reading symbols from /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug...done. done. Dwarf Error: could not find partial DIE containing offset 0x316 [in module /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug] (gdb) run Starting program: /usr/bin/python3 x.py (...) dodo ^C Program received signal SIGINT, Interrupt. 0x00007ffff6bf2787 in select () from /lib64/libc.so.6 (gdb) py-bt Traceback (most recent call first): <unknown at remote 0x7ffff7e5f7e0> Python Exception <class 'TypeError'> 'FakeRepr' object is not subscriptable: Error occurred in Python command: 'FakeRepr' object is not subscriptable The root issue comes from gdb: "Dwarf Error: could not find partial DIE containing offset 0x316 [in module /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug]" I debugged /usr/lib/debug/usr/lib64/libpython3.6m.so.1.0-3.6.6-1.fc28.x86_64.debug-gdb.py : the FakeRepr error indirectly comes from the fact that gdb fails to read debug symbols (the Dwarf Error). On the Python side, python-gdb.py should be enhanced to better handle such error (exception while computing the line number), but the root issue is in gdb which fails to read debug symbols. --- Additional comment from Victor Stinner on 2018-10-15 07:27:00 EDT --- > On the Python side, python-gdb.py should be enhanced to better handle such error (exception while computing the line number) I created https://bugs.python.org/issue34989 and proposed a fix for that.
Steps to reproduce the issue on Fedora 28: $ sudo dnf install gdb $ sudo dnf debuginfo-install python3 $ gdb python3 GNU gdb (GDB) Fedora 8.1.1-3.fc28 (...) Reading symbols from python3...Reading symbols from /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug...done. done. Dwarf Error: could not find partial DIE containing offset 0x316 [in module /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug] (gdb) The problem is the "Dwarf Error".
On Rawhide, the steps in Comment 1 result in the same Dwarf Error. Sergio, could you help with this issue? I don't know where to investigate further.
(In reply to Petr Viktorin from comment #2) > On Rawhide, the steps in Comment 1 result in the same Dwarf Error. > > Sergio, could you help with this issue? I don't know where to investigate > further. Sorry about the delay, this bug has fallen through the cracks. Anyway, with help from Keith and Jan we now have a patch for this issue. I expect to submit it this Thursday, let's see how upstream receives it. If everything goes well, I'll release a fixed GDB on Fedora by next week. Hope this helps, and thanks for the ping!
A patch has been posted upstream: https://sourceware.org/ml/gdb-patches/2018-11/msg00574.html And approved: https://sourceware.org/ml/gdb-patches/2018-11/msg00576.html 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 I'm working on backporting it to F28/F29 GDB now.
gdb-8.2-5.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1497d92365
gdb-8.1.1-4.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-c86898e4a7
gdb-8.1.1-4.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-c86898e4a7
gdb-8.2-5.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-1497d92365
gdb-8.2-5.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.
I tested again with gdb-8.2-3.fc29.x86_64 (with the bug): $ cat x.py import time def func(): time.sleep(2500) func() $ gdb -args python3 x.py (...) Dwarf Error: could not find partial DIE containing offset 0x7d [in module /usr/lib/debug/usr/bin/python3.7-3.7.1-4.fc29.x86_64.debug] I upgraded gdb to gdb-8.2-5.fc29.x86_64: $ gdb -args python3 x.py (...) Reading symbols from python3...Reading symbols from /usr/lib/debug/usr/bin/python3.7-3.7.1-4.fc29.x86_64.debug...done. (gdb) run (...) ^C (gdb) py-bt Traceback (most recent call first): <built-in method sleep of module object at remote 0x7fffea6fb688> File "x.py", line 3, in func time.sleep(2500) File "x.py", line 4, in <module> func() Great! It works as expected on Fedora 29 on an up-to-date system ;-)
*** Bug 1613614 has been marked as a duplicate of this bug. ***
gdb-8.1.1-4.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.