Bug ID 1169468
Summary devel:gcc/gdb: Bug gdb errors when exec'd from 'other' pyenv
Classification openSUSE
Product openSUSE.org
Version unspecified
Hardware x86-64
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component 3rd party software
Assignee matz@suse.com
Reporter pgnet.dev@gmail.com
QA Contact bnc-team-screening@forge.provo.novell.com
CC rguenther@suse.com
Found By ---
Blocker ---

running

    lsb_release -rd
        Description:    openSUSE Leap 15.1
        Release:        15.1

gdb -devel pkg

    rpm -qa | grep ^gdb-
        gdb-8.3.1-lp151.4.6.1.x86_64

from


installs & execs nicely, with system-installed python.

if, however, a separate pyenv has been installed, and is active, e.g.,

    pyenv versions
           2.7.17
         * 3.8-dev (set by /usr/local/pyenv/version)

then exec of packaged gdb fails (sort of),

     /usr/bin/gdb
         Error processing line 1 of
/usr/lib/python3.6/site-packages/Paste-3.0.4-py2.7-nspkg.pth:

           Traceback (most recent call last):
             File "/usr/lib64/python3.6/site.py", line 168, in addpackage
               exec(line)
             File "<string>", line 1, in <module>
             File "<frozen importlib._bootstrap>", line 568, in
module_from_spec
           AttributeError: 'NoneType' object has no attribute 'loader'

         Remainder of file ignored
         Error processing line 1 of
/usr/lib/python3.6/site-packages/jaraco.functools-1.20-py3.6-nspkg.pth:

           Traceback (most recent call last):
             File "/usr/lib64/python3.6/site.py", line 168, in addpackage
               exec(line)
             File "<string>", line 1, in <module>
             File "<frozen importlib._bootstrap>", line 568, in
module_from_spec
           AttributeError: 'NoneType' object has no attribute 'loader'

         Remainder of file ignored
         Error processing line 1 of
/usr/lib/python3.6/site-packages/sphinxcontrib_websupport-1.1.0-py3.5-nspkg.pth:

           Traceback (most recent call last):
             File "/usr/lib64/python3.6/site.py", line 168, in addpackage
               exec(line)
             File "<string>", line 1, in <module>
             File "<frozen importlib._bootstrap>", line 568, in
module_from_spec
           AttributeError: 'NoneType' object has no attribute 'loader'

         Remainder of file ignored
         GNU gdb (GDB; openSUSE Leap 15.1) 8.3.1
         Copyright (C) 2019 Free Software Foundation, Inc.
         License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
         This is free software: you are free to change and redistribute it.
         There is NO WARRANTY, to the extent permitted by law.
         Type "show copying" and "show warranty" for details.
         This GDB was configured as "x86_64-suse-linux".
         Type "show configuration" for configuration details.
         For bug reporting instructions, please see:
         <http://bugs.opensuse.org/>.
         Find the GDB manual and other documentation resources online at:
             <http://www.gnu.org/software/gdb/documentation/>.

         For help, type "help".
         Type "apropos word" to search for commands related to "word".
         (gdb)


iiuc, due to the hardcoded build-time spec's

     --with-python=%{_bindir}/%{python}            \

&/or the runtime

    ldd /usr/bin/gdb | grep py
        libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0
(0x00007f8262a54000)

a *local* build/install of gdb, built _within_ the pyenv, spec'ing its
repective "--with-python",

    which gdb
        /usr/local/gdb/bin/gdb
    gdb --version
        GNU gdb (GDB) 10.0.50.20200414-git
        Copyright (C) 2020 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.

works fine, also linked to the pyenv's correct python lib

    ldd `which gdb` | grep py
        libpython3.8.so.1.0 =>
/usr/local/pyenv/versions/3.8-dev/lib/libpython3.8.so.1.0 (0x00007f1eb6bba000)


the exec errors should be cleared or avoided

iiuc, system-packaged gdb should either

    link rpath'd to system python, and possibly spec PYTHON* env, so as not to
fire errors when used in a pyenv

or,

    adapt (not clear yet if/how this works) to being exec'd from within an
active, non-system pyenv


You are receiving this mail because: