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 629042 - GObject Introspection bindings deadlock when used from threaded program
GObject Introspection bindings deadlock when used from threaded program
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
2.21.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-08 10:26 UTC by Daniel P. Berrange
Modified: 2010-11-03 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Release python interpreter lock when calling into C functions (740 bytes, patch)
2010-09-08 10:26 UTC, Daniel P. Berrange
none Details | Review

Description Daniel P. Berrange 2010-09-08 10:26:39 UTC
Created attachment 169750 [details] [review]
Release python interpreter lock when calling into C functions

I have a threaded python app using PyGObject with some  GObject Introspection
bindings. One thread is feeding data to another thread via a queue. More often
than not, it deadlock the whole process. When this occurs I see one thread
trying to obtain the python interpreter lock, while another thread is sitting
in one of my app's C functions. The second thread should have released the
python interpreter lock before calling into my apps' C function, but it has
not.


Looking at the code, the problem appears to be that the _invoke_function() method in pygobject is missing calls to

    pyg_begin_allow_threads;
    pyg_end_allow_threads;

My immediate problem is with the Fedora build version pygobject2-2.21.5-3.fc14 (cf https://bugzilla.redhat.com/show_bug.cgi?id=631730), but latest GIT appears to still be missing these thread calls too, hence this BZ.
Comment 1 johnp 2010-10-13 18:04:10 UTC
Can you provide a simple test that deadlocks?