The python binding has a segmentation fault with gtk.threads_init() Examples: # Work import gtk import dbus gtk.threads_init() gtk.main() # Don't work (segmentation fault) import gtk import dbus gtk.threads_init() sbus = dbus.SessionBus() gtk.main() # Don't work import gtk import dbus sbus = dbus.SessionBus() gtk.threads_init() gtk.main()
Backtrace: #0 0x00d9471f in PyErr_Occurred () from /usr/lib/libpython2.3.so.1.0 #1 0x00d2dd8f in PyObject_Cmp () from /usr/lib/libpython2.3.so.1.0 #2 0x00ad674f in __pyx_f_13dbus_bindings_cmessage_function_handler (__pyx_v_connection=0x0, __pyx_v_msg=0x0, __pyx_v_user_data=0xf6c5608c) at dbus_bindings.c:422 #3 0x05b7090d in dbus_connection_dispatch (connection=0x94945e8) at dbus-connection.c:2550 #4 0x008824e8 in gsource_connection_dispatch (source=0x9551f50, callback=0, user_data=0x0) at dbus-gmain.c:258 #5 0x0023d1e2 in g_main_depth () from /usr/lib/libglib-2.0.so.0 #6 0x0023e2d8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #7 0x0023e610 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #8 0x0023ec53 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #9 0x0056578e in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 #10 0x0037afbd in _wrap_gtk_main (self=0x0) at gtk.override:867 #11 0x00d866fc in _PyEval_SliceIndex () from /usr/lib/libpython2.3.so.1.0 #12 0x00d8809e in PyEval_EvalCodeEx () from /usr/lib/libpython2.3.so.1.0 #13 0x00d88362 in PyEval_EvalCode () from /usr/lib/libpython2.3.so.1.0 #14 0x00da1817 in PyErr_Display () from /usr/lib/libpython2.3.so.1.0 #15 0x00da2942 in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.3.so.1.0 #16 0x00da3994 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.3.so.1.0 #17 0x00da868e in Py_Main () from /usr/lib/libpython2.3.so.1.0 #18 0x080485b2 in main ()
I'm looking at this
This is going to require a rewrite of the lowerlevel bindings in C. Going to get to that during Guadec
This is because the dbus bindings don't use Py_GILState_Ensure/Release. Patch attached.
Created attachment 2928 [details] xorg conf file (after problem was solved)
And updating the comment... ;) When you call back into Python, you need to make sure you have the GIL. This patch is needed for 0.23, CVS HEAD, and any other branches that are floating around.
I cleaned up the patch and updated this in HEAD. You will have to ping Joe Shaw to add this to the 0.23 branch.
*** Bug 2550 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.