[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] Bash not reacting to Ctrl-C
From: |
Oleg Nesterov |
Subject: |
Re: [BUG] Bash not reacting to Ctrl-C |
Date: |
Tue, 8 Feb 2011 22:17:13 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On 02/08, Bob Proulx wrote:
>
> Oleg Nesterov wrote:
> > $ sh -c 'while true; do /bin/true; done'
>
> Be careful that 'sh' is actually 'bash'. It isn't on a lot of
> machines. To ensure that you are actually running bash you should
> call bash explicitly. (At least we can't assume you are running bash
> otherwise.)
It is. In fact I did "./bash" while testing.
> Is the behavior you observe any different for this case?
>
> $ bash -c 'while true; do /bin/true || exit 1; done'
>
> Or different for this case?
>
> $ bash -e -c 'while true; do /bin/true; done'
The same.
I do not know what "-e" does (and I can't find it in man), but how
this can make a difference?
Once again. If bash gets ^C and at the same time the current foreground
child exits normally (either because this jctl signal races with exit()
or because the child hooks SIGINT and exits after that) SIGINT is lost.
set_job_status_and_cleanup() insists that WTERMSIG(child->status) should
be SIGINT, iow the child should be killed by the same signal. Otherwise
it is not going to kill itself, and the next wait_for() clears
wait_sigint_received.
This all looks intentional, but this means ^C can never work reliably.
Oleg.
- [BUG] Bash not reacting to Ctrl-C, Oleg Nesterov, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Chet Ramey, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Oleg Nesterov, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Bob Proulx, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C,
Oleg Nesterov <=
- Re: [BUG] Bash not reacting to Ctrl-C, Chet Ramey, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Ingo Molnar, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Chet Ramey, 2011/02/08
- Re: [BUG] Bash not reacting to Ctrl-C, Oleg Nesterov, 2011/02/09
- Re: [BUG] Bash not reacting to Ctrl-C, Bob Proulx, 2011/02/09
- Re: [BUG] Bash not reacting to Ctrl-C, Oleg Nesterov, 2011/02/09
- Re: [BUG] Bash not reacting to Ctrl-C, Linus Torvalds, 2011/02/10
- Re: [BUG] Bash not reacting to Ctrl-C, Illia Bobyr, 2011/02/11
- Re: [BUG] Bash not reacting to Ctrl-C, Oleg Nesterov, 2011/02/11
- Re: [BUG] Bash not reacting to Ctrl-C, Chet Ramey, 2011/02/28