Created attachment 197768 [details] Patch that fixes described issue In our system (http://www.freenas.org/) uwsgi application server calls a python program that calls a shell script that calls a shell script that calls bc and it hangs leaving us with hanging process tree like this: ``` 3135 |-- /usr/local/bin/uwsgi <...long text cut> 4435 | `-- /usr/local/bin/uwsgi <...long text cut> 8952 | |-- /bin/sh /usr/sbin/service smartd-daemon status 9087 | | `-- /bin/sh /usr/sbin/service smartd-daemon status 9088 | | `-- /bin/sh /usr/sbin/service smartd-daemon status 9090 | | `-- /usr/bin/bc 9091 | | `-- <defunct> ``` This happens because bc relies on SIGCHLD to determine that dc has completed, wait for it and exit on it's own. SIGCHLD is blocked by uwsgi and this blocking is inherited by each it's subprocess. Our shell scripts are rather complicated and call a lot of other programs and bc was the only one that has this issue, so, despite no specification defines who should clear process signal mask, caller or callee, I think this should be fixed with simple patch attached.