Bug 1578001

Summary: py-bt command is not found
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: python2Assignee: Charalampos Stratakis <cstratak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: bkabrda, cstratak, dmalcolm, jan.kratochvil, mcyprian, mhroncok, mshriver, pviktori, rkuska, tomspur, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python2-2.7.15-2.fc28 python2-2.7.15-2.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-21 14:04:03 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 Jan Kratochvil 2018-05-14 15:13:36 UTC
Description of problem:
SSIA

Version-Release number of selected component (if applicable):
python2-debuginfo-2.7.14-10.fc27.x86_64

How reproducible:
Always.

Steps to Reproduce:
# dnf debuginfo-install python2-2.7.14-10.fc27.x86_64
$ gdb python
(gdb) run
ctrl-c
(gdb) py-bt

Actual results:
Undefined command: "py-bt".  Try "help".

Expected results:
Traceback (most recent call first):

Additional info:
GDB tries to load:
  /usr/lib/debug/usr/lib64/libpython2.7.so.1.0.debug-gdb.py
but python2-debuginfo-2.7.14-10.fc27.x86_64 packages it as:
  /usr/lib/debug/usr/lib64/libpython2.7.so.1.0-gdb.py
python3 seems to have it fixed.

Comment 1 Mike Shriver 2018-05-14 17:16:06 UTC
Testing with the same versions, I found that copying libpython2.7.so.1.0.debug-gdb.py to libpython2.7.so.1.0-gdb.py in /usr/lib/debug/usr/lib64 resolved the loading of the plugin and gave access to python specific commands.

Comment 2 Charalampos Stratakis 2018-05-15 11:49:02 UTC
(In reply to Jan Kratochvil from comment #0)

> Additional info:
> GDB tries to load:
>   /usr/lib/debug/usr/lib64/libpython2.7.so.1.0.debug-gdb.py
> but python2-debuginfo-2.7.14-10.fc27.x86_64 packages it as:
>   /usr/lib/debug/usr/lib64/libpython2.7.so.1.0-gdb.py
> python3 seems to have it fixed.

The opposite is actually true. python2-debuginfo packages libpython2.7.so.1.0.debug-gdb.py however the plugin seems to work only if it's named libpython2.7.so.1.0-gdb.py instead.

In the case of python3 the plugin includes in its name the version and dist info (for multiarch parallel installability), e.g.

libpython3.6m.so.1.0-3.6.5-1.fc27.x86_64.debug-gdb.py

and it works properly. Will investigate further, hopefully it should be a simple fix.

Comment 3 Charalampos Stratakis 2018-05-15 12:26:12 UTC
Doing the same change in python2 results in fixing the issue when I tested it.

Effectively replacing [0]:

PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py

with:

PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py

Will push a fix.

[0] https://src.fedoraproject.org/rpms/python2/blob/master/f/python2.spec#_1252

Comment 4 Dave Malcolm 2018-05-15 13:02:41 UTC
Did something change recently in gdb when constructing the .py filenames to try autoloading? (for some definition for "recently")

Works for me on Fedora 26 with:

  gdb-8.0.1-33.fc26.x86_64

both for debugging Python 2:

  python2-2.7.14-7.fc26.x86_64
  python2-debuginfo-2.7.14-7.fc26.x86_64

where it's loaded from:
  /usr/lib/debug/usr/lib64/libpython2.7.so.1.0.debug-gdb.py

and for debugging Python 3:

  python3-3.6.5-1.fc26.x86_64
  python3-debuginfo-3.6.5-1.fc26.x86_64

where it's loaded from:
  /usr/lib/debug/usr/lib64/libpython3.6m.so.1.0.debug-gdb.py

Comment 5 Charalampos Stratakis 2018-05-15 13:32:21 UTC
(In reply to Dave Malcolm from comment #4)
> Did something change recently in gdb when constructing the .py filenames to
> try autoloading? (for some definition for "recently")
> 
> Works for me on Fedora 26 with:
> 
>   gdb-8.0.1-33.fc26.x86_64
> 
> both for debugging Python 2:
> 
>   python2-2.7.14-7.fc26.x86_64
>   python2-debuginfo-2.7.14-7.fc26.x86_64
> 
> where it's loaded from:
>   /usr/lib/debug/usr/lib64/libpython2.7.so.1.0.debug-gdb.py
> 
> and for debugging Python 3:
> 
>   python3-3.6.5-1.fc26.x86_64
>   python3-debuginfo-3.6.5-1.fc26.x86_64
> 
> where it's loaded from:
>   /usr/lib/debug/usr/lib64/libpython3.6m.so.1.0.debug-gdb.py

Your observation is correct, I tried in both Fedora 26 and Fedora 27 and indeed it broke on 27. I also see the same gdb version-release for both, and in pagure the gdb branches for F26 and F27 are merged, so I've no idea where the issue might be originating from.

Comment 6 Jan Kratochvil 2018-05-15 13:39:08 UTC
(In reply to Charalampos Stratakis from comment #5)
> Your observation is correct, I tried in both Fedora 26 and Fedora 27 and
> indeed it broke on 27. I also see the same gdb version-release for both, and
> in pagure the gdb branches for F26 and F27 are merged,

GDB just follows the .gnu_debuglink section.


> so I've no idea where the issue might be originating from.

From rpmbuild phase making that .gnu_debuglink section:
  https://fedoraproject.org/wiki/Releases/27/ChangeSet#Parallel_Installable_Debuginfo

Comment 7 Fedora Update System 2018-05-16 17:17:54 UTC
python2-2.7.15-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a56e55b708

Comment 8 Fedora Update System 2018-05-17 13:33:24 UTC
python2-2.7.15-2.fc27 has been pushed to the Fedora 27 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-a56e55b708

Comment 9 Fedora Update System 2018-05-17 13:51:04 UTC
python2-2.7.15-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-35f4106f77

Comment 10 Fedora Update System 2018-05-19 04:20:13 UTC
python2-2.7.15-2.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-35f4106f77

Comment 11 Fedora Update System 2018-05-21 14:04:03 UTC
python2-2.7.15-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2018-05-25 15:44:30 UTC
python2-2.7.15-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.