ImportError: No module named backtrace in file /usr/share/glib-2.0/gdb/gobject.py
Environment
- Red Hat Enterprise Linux (RHEL) 7.0
- glib2-2.36.3-5.el7
- glib2-devel-2.36.3-5.el7
Issue
-
When using
gdb
orgcore
python backtrace is displayed regardinggdb.backtrace
in/usr/share/glib-2.0/gdb/gobject.py
.[root@host]# gcore <PID> <snip> Using host libthread_db library "/lib64/libthread_db.so.1". Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3600.3-gdb.py", line 9, in <module> from gobject import register File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module> import gdb.backtrace ImportError: No module named backtrace Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3600.3-gdb.py", line 9, in <module> from gobject import register File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module> import gdb.backtrace ImportError: No module named backtrace
-
When using
gdb
orgcore
may see following warning messagegobject.pyc: gdb was not built with custom backtrace support, disabling.
Resolution
- Despite the
python
bactrace about the missinggdb.backtrace
module a core file is still produced. - Update to
glib2-2.40.0-4.el7
&glib2-devel-2.40.0-4.el7
(or later) to addressed the Traceback andNo module named backtrace
messages.- Note: The following warning message will still be present:
gobject.pyc: gdb was not built with custom backtrace support, disabling.
Red Hat is still discussing the removal if this message in BZ 1055733
- Note: The following warning message will still be present:
Root Cause
- The
backtrace.py
is not an official module of upstreamgdb
; however, apython
backtrace is being still being printed when it is not present on the system.
Diagnostic Steps
Upstream has dealt with this issue two different ways, with the second method being more elegantly done.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments