Bug 1055733

Summary: No module named backtrace in File "/usr/share/glib-2.0/gdb/gobject.py", line 3
Product: Red Hat Enterprise Linux 7 Reporter: Jan Kratochvil <jan.kratochvil>
Component: glib2Assignee: Colin Walters <walters>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: cpelland, cww, fschwarz, hartsjc, iweiss, jan.kratochvil, jpokorny, mcepl, mclasen, mhroncok, omajid, pmuldoon, rjones, sergiodj, tpelka, vanhoof, walters
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: glib2-2.42.2-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: The Python plugin for GDB used to debug glib2 applications did not function with the version of GDB in 7.1. Consequence: Errors were emitted by gdb when debugging glib2 applications. Fix: An upstream fix to use newer GDB APIs was included in the rebase. Result: The Python GDB debugging aid for glib2 applications now works without error.
Story Points: ---
Clone Of: 972351 Environment:
Last Closed: 2015-11-19 08:13:46 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:
Bug Depends On: 972351    
Bug Blocks: 1133060, 1205796    

Description Jan Kratochvil 2014-01-20 20:22:40 UTC
+++ This bug was initially created as a clone of Bug #972351 +++

Description of problem:

[Thread debugging using libthread_db enabled]
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.2-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.2-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


Version-Release number of selected component (if applicable):
Installierte Pakete
glib2.i686                                          2.36.2-1.fc19                                  @fedora  
glib2.x86_64                                        2.36.2-1.fc19                                  installed
glib2-devel.x86_64                                  2.36.2-1.fc19                                  installed

--- Additional comment from Phil Muldoon on 2013-08-20 18:06:54 CEST ---

The frame filters API was ported upstream to GDB.  Unfortunatley to do
what we wanted to do with it, and in the confines of the upstream
projects we were not able to provide API compatability.  However,
the two are fairly close.  It should just take a few changes.  The
good news is, as this was rewritten for upstream, it now works
with MI.  Also as it is now upstream it is available outside of
Fedora, or other projects that do not carry the experimental archer
patch-set.  With the above in mind, the archer patch for the old frame
filters was dropped as it conflicts with the new feature.

There is a guide to writing frame filters from the GDB manual here:

http://sourceware.org/gdb/current/onlinedocs/gdb/Writing-a-Frame-Filter.html#Writing-a-Frame-Filter

As well as am API guide to the Frame filter, and Frame decorator
interface here:

http://sourceware.org/gdb/current/onlinedocs/gdb/Frame-Filter-API.html#Frame-Filter-API

and

http://sourceware.org/gdb/current/onlinedocs/gdb/Frame-Decorator-API.html#Frame-Decorator-API

As well as API changes, there are frame filter management commands
available to the user:

http://sourceware.org/gdb/current/onlinedocs/gdb/Frame-Filter-Management.html#Frame-Filter-Management

I would be happy to assist you in making the change in any way I can.
You can either bring issues up here, or on the gdb
mailing list.

Cheers,

Phil

Comment 1 Matěj Cepl 2014-01-20 20:44:08 UTC
See also bug 972351 comment 24 (and attachment 852842 [details]).

Comment 2 Jan Kratochvil 2014-02-25 19:28:31 UTC
The proper fix is now upstream by Tom Tromey:
https://bugzilla.gnome.org/show_bug.cgi?id=623552#c11

Comment 3 RHEL Program Management 2014-03-22 06:11:40 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 James Hartsock 2014-08-06 15:54:41 UTC
Prior to finding this RHEL 7 BZ, I noticed that this looks to have been addressed 2 different ways upstream.


Think this may be the first upstream commit to address the issue. I was able to apply this patch to /usr/share/glib-2.0/gdb/gobject.py on RHEL 7.0 system.  With it applied, all I get is 'gobject.py: gdb was not built with custom backtrace support, disabling.' message and not the backtrace error output.
  https://bugzilla.gnome.org/show_bug.cgi?id=613732
  https://git.gnome.org/browse/glib/commit/?id=91d4659bbf8cf88d8be905c7e0abbedce931b688




That second, and as stated in https://bugzilla.gnome.org/show_bug.cgi?id=613732 more elegant method is:
  https://bugzilla.gnome.org/show_bug.cgi?id=623552
  https://git.gnome.org/browse/glib/commit/?id=20cda557e5766cc34af8efb3a6eb4cfcea149ea7

Comment 15 James Hartsock 2015-01-09 18:48:58 UTC
Test with RHEL 7.0 without glib2-devel, no error
~~~
# rpm -qa | grep -e ^gdb -e ^glib2
gdb-7.6.1-51.el7.x86_64
glib2-2.36.3-5.el7.x86_64
gdbm-devel-1.10-8.el7.x86_64
gdbm-1.10-8.el7.x86_64

# gcore 11583
[New LWP 12764]
<snip>
[New LWP 11612]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f0ca4c01bdd in poll () from /lib64/libc.so.6
Saved corefile core.11583
~~~

Test with RHEL 7.0 and glib2-devel installed to get initial issue
~~~
# rpm -qa | grep -e ^gdb -e ^glib2
gdb-7.6.1-51.el7.x86_64
glib2-2.36.3-5.el7.x86_64
glib2-devel-2.36.3-5.el7.x86_64
gdbm-devel-1.10-8.el7.x86_64
gdbm-1.10-8.el7.x86_64

# gcore 11583
[New LWP 12764]
<snip>
[New LWP 11612]
[Thread debugging using libthread_db enabled]
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
0x00007f0ca4c01bdd in poll () from /lib64/libc.so.6
Saved corefile core.11583
~~~




Now RHEL 7.1 beta -- can see that still get the "gobject.py: gdb was not built with custom backtrace support, disabling."" warning, but this is still better.  
~~~
# rpm -qa | grep -e ^gdb -e ^glib2
glib2-devel-2.40.0-4.el7.x86_64
gdb-7.6.1-64.el7.x86_64
gdbm-1.10-8.el7.x86_64
glib2-2.40.0-4.el7.x86_64

# gcore 27448
[New LWP 27518]
<snip>
[New LWP 27465]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
gobject.pyc: gdb was not built with custom backtrace support, disabling.
0x00007f14fb2a99ed in poll () from /lib64/libc.so.6
Saved corefile core.27448
~~~


So does the BZ need to be re-assigned to address the remaining warning or should it just be closed since the traceback is no longer printed in RHEL 7.1?

Comment 16 Jan Kratochvil 2015-01-11 20:46:31 UTC
Comment 13 describes that glib2-2.40.0 does not contain the full fix.

glib2-devel-2.40.0-4.el7 does not contain the backport of <https://git.gnome.org/browse/glib/commit/?id=20cda557e5766cc34af8efb3a6eb4cfcea149ea7> therefore Comment 15's behavior is expected.  This Bug is not devel_acked for RHEL-7.1, therefore it is not fixed, as expected.

Comment 19 Colin Walters 2015-04-16 22:27:47 UTC
This was already fixed as part of the rebase to 2.42 in bug 1203755.

Comment 22 errata-xmlrpc 2015-11-19 08:13:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2116.html