GNOME Bugzilla – Bug 734035
gedit hangs up when there's no GSettings key in the registry
Last modified: 2014-07-31 10:47:52 UTC
This happens because watch_add_notify() enters the critical section, but does not release it when returning. As a result, the watch thread remains blocked, and later on gsettings finalizer hangs up waiting for the watch thread to die.
Created attachment 282132 [details] [review] Ensure critial sections are released before returning
Review of attachment 282132 [details] [review]: See the comment ::: gio/gregistrysettingsbackend.c @@ +1757,3 @@ + if (cache_node == NULL || cache_node->data == NULL) + { + LeaveCriticalSection (self->cache_lock); the point of g_return_val_if_fail is to also get a warning that we should not reach here. Use g_return_val_if_reached
Created attachment 282133 [details] [review] Ensure critial sections are released before returning v2: use "g_return_val_if_reached (FALSE);" instead of "return FALSE;"
Review of attachment 282133 [details] [review]: Looks good to me. Let's get an ack from a glib dev.
I'd probably use: g_warn_if_reached (); return FALSE; instead, since that one does not get elided by defining G_DISABLE_CHECKS.
Created attachment 282134 [details] [review] Ensure critial sections are released before returning v3: Use "g_warn_if_reached (); return FALSE"
Backtrace (of the main thread hanging in gsettings finalizer):
+ Trace 233899
Review of attachment 282134 [details] [review]: I think this looks good; maybe Ryan wants to pitch in, but since it's the Windows registry backend I think it's pretty safe to say you and nacho are the maintainers. ;-)
Attachment 282134 [details] pushed as 905a8e6 - Ensure critial sections are released before returning