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.