[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash-5.1.16 fails to unlink named pipes if pipeline terminates prema
Re: bash-5.1.16 fails to unlink named pipes if pipeline terminates prematurely
Mon, 19 Sep 2022 15:49:46 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2
On 9/12/22 5:52 PM, RVP wrote:
On Fri, 9 Sep 2022, Chet Ramey wrote:
Bash is out of the picture by the time the diff command dies due to
SIGPIPE. It performs word expansions, including process substitution,
and execs diff. It's no longer around to remove the named pipes.
Without the `| head' to provoke a SIGPIPE, the named pipes are removed.
It's not the SIGPIPE per se; the bash fatal signal handler removes existing
named pipes when it dies due to SIGPIPE.
In the pipeline case, bash optimizes away the fork for the `diff' and just
executes it. When the SIGPIPE comes, bash is out of the picture.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU firstname.lastname@example.org http://tiswww.cwru.edu/~chet/