GNOME Bugzilla – Bug 731771
Child watch handler never invoked
Last modified: 2014-06-17 11:16:06 UTC
I've come across races where processes are started, watched (via g_child_watch_soucre_new()) and killed very rapidly. In some cases the handler for the watch is never called. I'm filing this as a bug so I can try and fix it. I realize this would be really hard to reproduce.
glib2-2.38.2-2.fc20.x86_64 The process that is watching, and is hung, waiting for child handler to be called: 23268 pts/3 Sl+ 0:00 x86_64/test-webservice -p /web-service/resource The process being watched: 23278 pts/3 Z+ 0:00 [cockpit-agent] <defunct> Source not invoked: (gdb) p *(GChildWatchSource *)tc->pipe->priv->child $2 = {source = {callback_data = 0xad8ba0, callback_funcs = 0x3f4b12a8e0 <g_source_callback_funcs>, source_funcs = 0x3f4b12a960 <g_child_watch_funcs>, ref_count = 2, context = 0xacc620, priority = 0, flags = 1, source_id = 27, poll_fds = 0x0, prev = 0x0, next = 0xad8ed0, name = 0x0, priv = 0xac6500}, pid = 23278, child_status = 0, child_exited = 0} And then the following clears the hang: $ kill -CHLD 23268 This leads me to infer that there's a race in the SIGCHLD handling in gmain.c.
This is very likely a duplicate of #711090. I'm having a hard time reproducing it with git master. *** This bug has been marked as a duplicate of bug 711090 ***