#1031004 gdb should be able to run without python support when not available

Package:
gdb
Source:
gdb
Description:
GNU Debugger
Submitter:
Vincent Lefevre
Date:
2023-02-10 14:00:11 UTC
Severity:
normal
#1031004#5
Date:
2023-02-10 10:47:29 UTC
From:
To:
When python is not available, e.g. in firejail with some profiles
(for security reasons), gdb refuses to run:

zira:~> firejail --allow-debuggers --profile=firefox
zira% gdb
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/usr/lib/python3.11'
  sys._base_executable = '/usr/bin/python'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/bin/python'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python311.zip',
    '/usr/lib/python3.11',
    '/usr/lib/python3.11/lib-dynload',
  ]
Python Exception <class 'ModuleNotFoundError'>: No module named 'encodings'
Python not initialized
zira%

gdb should dynamically consider that python is optional and run
without python support in such a case.

Note that there is no issue with the dynamical linking against the
/usr/lib/x86_64-linux-gnu/libpython3.11.so.1.0 library; it is just
that the /usr/lib/python3.11 directory is not available.

#1031004#10
Date:
2023-02-10 12:46:13 UTC
From:
To:
Hello,

Could you use gdb-minimal instead?

Regards

#1031004#15
Date:
2023-02-10 13:57:51 UTC
From:
To:
gdb-minimal does not provide source highlighting, and there may be
other missing features that can be used in firejail.