bug-bash
[Top][All Lists]
Advanced

[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: Wed, 9 Feb 2011 22:44:34 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On 02/09, Bob Proulx wrote:
>
> Ingo Molnar wrote:
> > Could you try the reproducer please?
> >
> > Once you run it, try to stop it via Ctrl-C, and try to do this a
> > couple of times.
>
> I was not able to reproduce your problem using your (I believe to be
> slightly incorrect) test case:
>
>   bash -c 'while true; do /bin/true; done'
>
> It was always interrupted with a single control-C on my amd64 Debian
> Squeeze machine.  I expect this means that by chance it was always
> bash running in the foreground process and /bin/true never happened to
> be there at the right time.
>
> > Do you consider it normal that it often takes 2-3 Ctrl-C attempts to
> > interrupt that script, that it is not possible to stop the script
> > reliably with a single Ctrl-C?
>
> Since the exit status of /bin/true is ignored then I think that test
> case is flawed.  I think at the least needs to check the exit status
> of the /bin/true process.
>
>   bash -c 'while true; do /bin/true || exit 1; done'

Perhaps I misread job.c (this is very posible). But afaics bash
always checks "status" after waitpid(&status), and the exit code
does not matter at all. What does matter is whether WIFSIGNALED()
and WTERMSIG() == SIGINT or not.

Oleg.




reply via email to

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