GNOME Bugzilla – 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
Last modified: 2010-06-21 03:06:25 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):
+ Trace 221694
from gobject import register
import gdb.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)
*** Bug 617585 has been marked as a duplicate of this bug. ***
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.
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)
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
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".
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.
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.
fixed in commit 4394826
Oh thanks, the error handling looks much better now :-) http://git.gnome.org/browse/rhythmbox/commit/?id=4394826f36fad0ad36ea773b6d4525dfcfcd389b
(In reply to comment #8) > fixed in commit 4394826 Thank you!
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.
*** Bug 620147 has been marked as a duplicate of this bug. ***
*** Bug 622130 has been marked as a duplicate of this bug. ***