After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617587 - Rhythmbox 0.12.8 will break with upcoming python-2.6.6 and is broken on gentoo's python-2.6.5-r2 with backports
Rhythmbox 0.12.8 will break with upcoming python-2.6.6 and is broken on gento...
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Programmatic interfaces
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 617585 620147 622130 (view as bug list)
Depends on:
Blocks: 617821
 
 
Reported: 2010-05-03 22:34 UTC by Michael Weber
Modified: 2010-06-21 03:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
changes pygtk.require("2.8") to pygtk.require("2.0") (597 bytes, patch)
2010-05-05 00:15 UTC, Michael Weber
none Details | Review
changes pygtk.require("2.8") to pygtk.require("2.0") (461 bytes, patch)
2010-05-05 00:28 UTC, Michael Weber
none Details | Review

Description Michael Weber 2010-05-03 22:34:20 UTC
Today, Gentoo linux users have discovered segfaults during startup 
with python-2.6.5-r2, which includes backported patches from the
 upcoming Python 2.6.6 release.

Please see  http://bugs.gentoo.org/show_bug.cgi?id=318333 for detailed discussion.


michael@pandora ~ % gdb /usr/bin/rhythmbox

warning: Can not parse XML syscalls information; XML support was disabled at compile time.
GNU gdb (Gentoo 7.0 p1) 7.0
Copyright (C) 2009 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-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/rhythmbox...done.
(gdb) run
Starting program: /usr/bin/rhythmbox 
[Thread debugging using libthread_db enabled]
Traceback (most recent call last):
  • File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.2400.0-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
[New Thread 0x7fffe5b92710 (LWP 14222)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7af951d in rb_python_module_load_with_gil (module=0x9adb00) at rb-python-module.c:366
366	rb-python-module.c: No such file or directory.
	in rb-python-module.c
(gdb)
Comment 1 dabbott 2010-05-03 22:51:26 UTC
*** Bug 617585 has been marked as a duplicate of this bug. ***
Comment 2 Jonathan Matthew 2010-05-04 21:02:59 UTC
Thanks for reporting this, but I'm not going to be able to fix it until python 2.6.6 appears on one of my systems.
Comment 3 Victor STINNER 2010-05-04 22:58:37 UTC
Rhythmbox calls the Python function pygtk.require("2.8") which
fails. A Python error is set (assertion error from pygtk.py about the version).
But Rhythmbox doesn't check PyObject_CallObject() result (on success, it should
also call Py_DECREF() on the result to avoid a reference leak).

*Thanks to* python-2.6-r79204.patch, the import machinery of Python doesn't
swallow errors anymore and so init_pygobject() fail because of the previous
error and raise a new error.

The bug comes from Rhytmbox bug and was detected thanks to recent patches in
Python (backported by Arfrever to Python 2.6.5 in Gentoo). Rhytmbox have to
check the result of PyObject_CallObject(): destroy the result on success
(Py_DECREF), or display the error. rb_plugins_engine_init() should also fail if
rb_python_module_init_python() fails instead of ignoring
rb_python_module_init_python() error and crash later.

(see also https://bugs.gentoo.org/show_bug.cgi?id=318333 for the whole story)
Comment 4 Victor STINNER 2010-05-04 23:00:47 UTC
Oh, and init_gobject() is deprecated:

/* deprecated macro, use pygobject_init() instead. */
#define init_pygobject() G_STMT_START {         \
    if (!pygobject_init(-1, -1, -1))            \
        return;                                 \
} G_STMT_END
Comment 5 Victor STINNER 2010-05-04 23:12:59 UTC
On debian sid (pygtk 2.17) and on Ubuntu 9.10 (pygtk 2.16), pygtk.require("2.8") fails with an assertion error, whereas pygtk.require("2.0") works correctly.

Rhythmbox should also use "2.0" instead of "2.8".
Comment 6 Michael Weber 2010-05-05 00:15:59 UTC
Created attachment 160309 [details] [review]
changes pygtk.require("2.8") to pygtk.require("2.0")

Please look at /usr/lib64/python2.6/site-packages/pygtk.py

The parameters to pygtk.require() is first matched against '2.0'.
If it's - like here - '2.8' the a string search in the elements of
sys.path is started, looking for something named gtk-2.8. 
But any seen version of pygtk is installed as site-packages/gtk-2.0
which leads to an assert fail, that will no longer be ignored in python 2.6.6 
( http://svn.python.org/view?view=rev&revision=79204 ) and leads to a segfault and this bug.

So, please accept this patch to fix this. 
Version >=pygtk-2.8 should be matched by every distribution by now.
Comment 7 Michael Weber 2010-05-05 00:28:04 UTC
Created attachment 160310 [details] [review]
changes pygtk.require("2.8") to pygtk.require("2.0")

Please look at /usr/lib64/python2.6/site-packages/pygtk.py

The parameters to pygtk.require() is first matched against '2.0'.
If it's - like here - '2.8' the a string search in the elements of
sys.path is started, looking for something named gtk-2.8. 
But any seen version of pygtk is installed as site-packages/gtk-2.0
which leads to an assert fail, that will no longer be ignored in python 2.6.6 
( http://svn.python.org/view?view=rev&revision=79204 ) and leads to a segfault
and this bug.

So, please accept this patch to fix this. 
Version >=pygtk-2.8 should be matched by every distribution by now.
Comment 8 Jonathan Matthew 2010-05-05 13:02:42 UTC
fixed in commit 4394826
Comment 9 Victor STINNER 2010-05-05 13:16:38 UTC
Oh thanks, the error handling looks much better now :-)

http://git.gnome.org/browse/rhythmbox/commit/?id=4394826f36fad0ad36ea773b6d4525dfcfcd389b
Comment 10 Michael Weber 2010-05-05 14:06:30 UTC
(In reply to comment #8)
> fixed in commit 4394826

Thank you!
Comment 11 Jonathan Matthew 2010-05-05 20:57:41 UTC
I opened bug 617821 for the same problem in totem.  This doesn't appear to apply to epiphany (no python plugins any more) or gedit (plugin code appears to have been rewritten), and I don't think the plugin code we stole from gedit was used anywhere else.
Comment 12 Fabio Durán Verdugo 2010-05-31 15:43:05 UTC
*** Bug 620147 has been marked as a duplicate of this bug. ***
Comment 13 Fabio Durán Verdugo 2010-06-21 03:06:25 UTC
*** Bug 622130 has been marked as a duplicate of this bug. ***