Re: [PATCH] x86_64: fix delayed signals

From: Linus Torvalds
Date: Sat Jul 12 2008 - 13:43:12 EST




On Sat, 12 Jul 2008, Andi Kleen wrote:
>
> Linus, the fact that is not explained by your theory is why
> Ctrl-Z+kill works but Ctrl-C doesn't.

Umm. Read the reports more carefully. Many of the complaints are about ^Z
too.

More-over, ^Z and ^C are very different from an app standpoint. A _lot_ of
applications block or catch ^C (SIGINT), while doing the same for ^Z
(SIGTSTP) and SIGTERM is much less common (but possible: a tty sends
SIGTSTP, which is blockable, not SIGSTOP, which is not).

The reason? It's quite common to catch ^C in order to do cleanup. The
common handler case is that you catch SIGINT, do cleanup, and then kill
yourself with SIGINT in order to make it _look_ like you reacted directly
to the ^C.


So there are a _lot_ of loads where ^C will not kill things immediately,
but ^Z + SIGKILL (or SIGTERM, the default for "sig") will.

Try doing a "yum update", for example.

Or use 'git', for that matter. git does exactly that kind of thing:
catches SIGINT and removes temp-files etc. But if you kill it manually
using some "stronger" signal (and using ^Z to get the shell back before
you do that is obviously one way), that won't happen.

And trust me, git is not at all unusual in this respect.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/