Hide Forgot
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:
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.
> 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.
> the root issue is in gdb which fails to read debug symbols I created bug #1639242 to track the gdb issue.
Looks issue if fixed on python side, any chance to get the fix in Fedora 29?
The Python change is just to get a better error message. The issue needs to be fixed in gdb.
gdb has been fixed in Fedora 28 and 29 and I confirm that it fixed the py-bt command: https://bugzilla.redhat.com/show_bug.cgi?id=1639242#c10 *** This bug has been marked as a duplicate of bug 1639242 ***