bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Obscure issue with process substitution since bash-5.0.016 upgrade


From: Joan Bruguera Micó
Subject: Obscure issue with process substitution since bash-5.0.016 upgrade
Date: Thu, 2 Apr 2020 04:15:41 +0200

I'm having a problem with a script that used to work, which I reduced
to the following test case:

    #!/bin/bash

    function docat() {
        for x in 1 2 3 ; do true; done
        cat "$@"
    }

    for x in $(seq 25); do
        docat <(echo a) <(echo a) <(echo a) <(echo a) <(echo a) <(echo a)
    done

Expected behaviour: A lot of lines with an "a" are printed

Actual behaviour: Some lines with an "a" are printed but a lot of
prints fail with an error:

    [...]
    a
    cat: /dev/fd/63: No such file or directory
    cat: /dev/fd/62: No such file or directory
    cat: /dev/fd/61: No such file or directory
    cat: /dev/fd/60: No such file or directory
    a
    [...]

Now if you remove the apparently useless for loop in the first line of
docat, this works as I would expect. It also works on zsh.

After some head banging I found that what makes the difference is the
latest bash update, bash-5.0.016. On bash-5.0.015 this script works,
so the the patch that makes the difference is this one:
https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-016

Was the script technically wrong but worked due to some bash
implementation detail, or is this could actually a problem with bash?

I found a very similar report in
https://lists.gnu.org/archive/html/bug-bash/2020-03/msg00062.html ,
but I'm not sure if it's the same underlying issue, since that
particular case is said to be introduced between 4.4-5.0, and this one
is between 5.0.015-5.0.016, and no fix is yet available to test.

Thanks for your help,
- Joan Bruguera

PS: This is the first time I post to the mailing list, so preemptive
apologies for any mistake I could have made.



reply via email to

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