On 1/30/18 3:04 PM, Øyvind Hvidsten wrote:
Bash Version: 4.4
Patch Level: 12
Release Status: release
Description:
Running the included script, which does nothing useful but is cut down
a lot to demonstrate the issue, my main computer (amd64 based) counts to
several million, then Bash stops responding, using 100% cpu and ends up
with a defunct subshell. On my Raspberry Pi, running Raspbian Stretch and
the same version of Bash (4.4.12), the same thing happens after only a few
thousand iterations.
Repeat-By:
for ((i=0; ; i++)); do ((i%100)) || echo $i; exec {fd}<> >(:); read -t
0.001 -u $fd; exec {fd}>&-; done
In one sense, it's surprising that this works at all. You're opening a file
descriptor read-write (and trying to read from it) to a pipe that's opened
for writing only (the >(command) form is supposed to be used by processes
that write to the resulting file).