Bug 1844 - python bindings must call Py_GILState_Ensure/Release
Summary: python bindings must call Py_GILState_Ensure/Release
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: John (J5) Palmieri
QA Contact:
URL:
Whiteboard:
Keywords:
: 2550 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-13 04:27 UTC by Lipp Simon
Modified: 2006-08-01 10:27 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Lipp Simon 2004-11-13 04:27:12 UTC
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()
Comment 1 David Eriksson 2004-11-29 12:58:06 UTC
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 ()
Comment 2 John (J5) Palmieri 2005-05-05 11:34:52 UTC
I'm looking at this
Comment 3 John (J5) Palmieri 2005-05-16 14:09:17 UTC
This is going to require a rewrite of the lowerlevel bindings in C.  Going to
get to that during Guadec
Comment 4 Anthony Baxter 2005-06-20 08:17:53 UTC
This is because the dbus bindings don't use Py_GILState_Ensure/Release. 

Patch attached.
Comment 5 Anthony Baxter 2005-06-20 08:20:40 UTC
Created attachment 2928 [details]
xorg conf file (after problem was solved)
Comment 6 Anthony Baxter 2005-06-20 08:23:06 UTC
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.
Comment 7 John (J5) Palmieri 2005-06-28 12:37:20 UTC
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.
Comment 8 John (J5) Palmieri 2005-06-29 12:16:06 UTC
*** 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.