bug-bash
[Top][All Lists]
Advanced

[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


From: Chet Ramey
Subject: Re: bash-5.1.16 fails to unlink named pipes if pipeline terminates prematurely
Date: Fri, 9 Sep 2022 11:23:06 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

On 9/9/22 3:11 AM, RVP wrote:

Bash Version: 5.1
Patch Level: 16
Release Status: release

Description:
      On FreeBSD 13.1-RELEASE-p2, /dev/fd may not always be mounted,
      therefore bash-5.1.16 is configured with `bash_cv_dev_fd=absent'.
      In this situation, bash does not unlink named pipes used for
      process-substitution when a pipeline terminates prematurely.

Repeat-By:
      $ diff -u <(ls -l /usr/bin) <(ls -l /tmp) | head >/dev/null
      $ ls -l /tmp/sh-np.*
      prw-------  1 rvp  wheel  0  8 Sep 22:52 /tmp/sh-np.N59YMr
      prw-------  1 rvp  wheel  0  8 Sep 22:52 /tmp/sh-np.S9X8Fr

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.

This is one reason why bash prefers to use /dev/fd if it's available.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]