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 731771 - Child watch handler never invoked
Child watch handler never invoked
Status: RESOLVED DUPLICATE of bug 711090
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-17 10:30 UTC by Stef Walter
Modified: 2014-06-17 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stef Walter 2014-06-17 10:30:19 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.
Comment 1 Stef Walter 2014-06-17 10:33:52 UTC
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.
Comment 2 Stef Walter 2014-06-17 11:16:06 UTC
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 ***