GNOME Bugzilla – Bug 586432
deadlock in gio/tests/unix-streams (cancellation vs _g_fd_source)
Last modified: 2010-08-03 14:44:18 UTC
(gdb) thread 1 [Switching to thread 1 (Thread 0xb7fd7930 (LWP 17631))]#0 0x00d1c424 in __kernel_vsyscall () (gdb) bt
+ Trace 216097
That is, thread 1 (the main thread) is in a main loop callback (thus holding the GMainContext's lock) where it is waiting for main_cancel to finish cancelling so it can disconnect from it. Thread 3 is in the midst of emitting "cancelled" on main_cancel, and as part of that needs to acquire the GMainContext's lock so it can wake it up.
I think the easiest fix for this would be to make fd_source_finalize not block, by using g_signal_handler_disconnect instead of g_cancellable_disconnect ?
I see you already committed a fix to unix-streams.c When I filed the bug, shortly after bug 572844 was committed, I was worried that it indicated a general problem with g_cancellable_connect/disconnect that would pop up in other places as well. I guess it didn't.
Well, I committed a workaround to stop the test from hanging I still think this ought to be fixed in gasynchelper.c