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 632884 - Possible deadlock in g_object_remove_toggle_ref()
Possible deadlock in g_object_remove_toggle_ref()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-10-22 11:36 UTC by Florian Müllner
Modified: 2010-10-22 12:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix deadlock in g_object_remove_toggle_ref() (1.13 KB, patch)
2010-10-22 11:36 UTC, Florian Müllner
none Details | Review
Test case (485 bytes, text/plain)
2010-10-22 12:48 UTC, Alberto Garcia
  Details

Description Florian Müllner 2010-10-22 11:36:01 UTC
See the commit message of the attached patch for a description of the problem. The proposed patch WorksForMe(tm), but I'm not too confident about moving the call to g_object_unref() out of the guarded section being safe and sound, so comments welcome.
Comment 1 Florian Müllner 2010-10-22 11:36:04 UTC
Created attachment 172993 [details] [review]
Fix deadlock in g_object_remove_toggle_ref()

The code section guarded with toggle_refs_mutex includes a call to
g_object_unref(), which may call toggle_refs_notify(). As the latter
tries to acquire the same mutex, glib locks up.
Comment 2 Alberto Garcia 2010-10-22 12:48:36 UTC
Created attachment 172996 [details]
Test case

Indeed, here's a test case. Thanks for finding this
Comment 3 Allison Karlitskaya (desrt) 2010-10-22 12:53:07 UTC
Thanks