bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

Reset SIGCHLD action to SIG_DFL

Open joelpelaez opened this issue 3 months ago • 4 comments

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

joelpelaez avatar Nov 05 '25 05:11 joelpelaez

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.

gamax92 avatar Nov 11 '25 20:11 gamax92

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.

smcv avatar Nov 11 '25 22:11 smcv

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.

joelpelaez avatar Nov 11 '25 23:11 joelpelaez

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.

smcv avatar Dec 03 '25 10:12 smcv