Reset SIGCHLD action to SIG_DFL
Some applications, like Erlang, call sigaction for SIGCHLD with sa.sa_action = SIG_IGN, this causes bwrap never read child process exit status from signalfd.
That behavior is explained in the function do_notify_parent at kernel/signal.c from linux kernel source, to be exact, in this section evaluates the signal action value:
https://github.com/torvalds/linux/blob/284922f4c563aa3a8558a00f2a05722133237fe8/kernel/signal.c#L2232-L2253
This fixes #705
This bug is also affecting running volumeicon with the new glycin based loader for gdk-pixbuf. Without the patch, bwrap hangs in monitor_child, and starts up correctly with.
This seems more like a workaround than a solution: applications can't just assume that every subprocess that they might run can cope with functionally-significant signals being blocked.
This seems more like a workaround than a solution: applications can't just assume that every subprocess that they might run can cope with functionally-significant signals being blocked.
Some applications like Erlang sets SIGCHLD to SIG_IGN because "recognized" children process are fork'ed using a helper child process, but this issue is related to an "unrecognized" child process started by an external library of an plugin, in this example is because Erlang has a wxWidgets graphical wrapper that uses GTK and it uses glycin for image loading.
I think that if an program has to manage children processes it must set the necessary signal settings for work properly.
I think that if an program has to manage children processes it must set the necessary signal settings for work properly.
Sure, but this reasoning applies equally to Erlang: it can't just break normal process management and assume that everything will be OK.