New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash uses 100% CPU on ctrl-c and never exits #4854
Comments
What is the output of |
Currently running off of master as of 1 hour ago 6643cc2, failed also on 0.9.0. Haven't tried against the just released 0.9.1
Git commit (client): 2b3fdf2 |
Notes - just running the command in gdb at ctrl-c works
|
If I use nsenter to get in the container using your docker command I get
|
@creack post on IRC: pid namespace / (2) waitpid() failure (after 20 second of looking without testing anything nor looking at the code) |
In container before ctrl-c
Once we've ctrl-c d
We've lost our child sleep, @creack reminds us pid 1 is not interruptible. According to the dbgsym we're probably in the tight loop in http://git.savannah.gnu.org/cgit/bash.git/tree/jobs.c?id=bash-4.2#n2490
|
@ibuildthecloud what are you trying to achieve here which led to this reproducer |
Workaround in this case is to use
As per the comment in http://git.savannah.gnu.org/cgit/bash.git/tree/jobs.c?id=bash-4.2#n2481
|
What I was doing was running just a regular bash script. I found if I put a
|
Does your script work with Longer term @creack says long running dockerinit will fix this, you could look and see how the job code works in bash 4.3 or later. There do seem to be some changes there http://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES A quick-ish way to do this would be to pull/update debian:sid |
FWIW just tried with 4.3 and no joy. |
For a current work around I just double exec the script. Something like if [ "$$" = 1 ]; then
$0 "$@"
exit $?
fi |
FWIW this also fails in the lxc driver. I'm guessing this issue isn't really a docker related issue, so it can be closed. Agreed that a log running dockerinit will fix this, and would welcome that change as running things as pid 1 is often wonky. Could somebody explain to me though why
will exit fine on a ctrl-c, but
hangs? The different between the two commands being that one traps SIGINT and the other uses the special bash EXIT. |
For the record, using |
Run the below command
Once you see
sleep
echo'd, hit ctrl-c. If you now do a strace on the bash process you will see the below over and over againThe text was updated successfully, but these errors were encountered: