On 3/17/21 11:17 AM, Michael Felt wrote:

On 11/03/2021 18:11, Chet Ramey wrote:
On 3/11/21 11:28 AM, Michael Felt wrote:
Hi,

Issue: AdoptOpenJDK build process makes bash calls in a particular way. An abbreviated (shorter pathnames) example is:

```
bash-5.0$ /usr/bin/printf "Building targets 'product-images legacy-jre-image test-image' in configuration 'aix-ppc64-normal-server-release'\n" > >(/usr/bin/tee -a /home/aixtools/build.log) 2> >(/usr/bin/tee -a /home/aixtools/build.log >&2) Building targets 'product-images legacy-jre-image test-image' in configuration 'aix-ppc64-normal-server-release'

I believe this is fixed in bash-5.1.


I added some debug statements to try and catch what is not happening. It seems that the fifo_list[i].proc value is never being set to (pid_t)-1 so any call to `unlink_fifo()` or `unlink_fifo_list()` does not unlink the special file created.

Probably because the process substitution does not exit before the shell does.

I spent several days debugging - and, basically, they never get cleared because the fifo_struct never gets the (pid_t) -1 value assigned.

Although the `reap` function does get called - there is never anything to do.

The routine that does assign the (pid_t) -1 value is `wait`*something - and this is only called via an interrupt (aka signal) - as far as I could see.

Probably because the process substitution does not exit before the shell
does. The shell doesn't wait for asynchronous processes before it exits,
so if the process doesn't exit and the shell doesn't get a SIGCHLD, it
won't reap that process.

The bash-5.1 solution is pretty heavy-handed: unlink all FIFOs it thinks
still exist before the shell exits.


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

Reply via email to