bug-bash
[Top][All Lists]
Advanced

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

Possible regression in 'wait' command


From: Jonas Alfredsson
Subject: Possible regression in 'wait' command
Date: Thu, 13 May 2021 19:44:48 +0000

Configuration Information:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux 5d99d2eaceed 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 
(2021-03-19) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Extra info: Docker version 20.10.6, build 370c289

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

Description:
If one has a script similar to this:

```bash
trap 'echo "Received SIGHUP"' HUP

sleep 5m &
child_pid=$!

wait -n ${child_pid}
wait -n ${child_pid}
```

and you send in the system signal SIGHUP the first `wait` will exit (as 
expected)
and the message "Received SIGHUP" will be printed. However, since we have a
second `wait` it should catch further execution and wait for the child once 
again.

This is how it works in Bash 5.0.x, but on 5.1.0 the second `wait` fails with 
exit
code 127. Unfortunatly I do not know the low level stuff well enough to even
know where to begin debugging this, but I am willing to help as much as possible
if given a little guidance.

Repeat-By:
I have created a repository with a Dockerfile and a script that makes this
repeatable by at least one more person than me. Please check it out for
more details (or if you want I can include it in a follow up mail if requested)
https://github.com/JonasAlfredsson/bash_fail-to-wait

reply via email to

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