2

The Linux Programming Interface says:

TASK_KILLABLE : This state is like TASK_UNINTERRUPTIBLE , but wakes the process if a fatal signal (i.e., one that would kill the process) is received. By converting relevant parts of the kernel code to use this state, various scenarios where a hung process requires a system restart can be avoided. Instead, the process can be killed by sending it a fatal signal. The first piece of kernel code to be converted to use TASK_KILLABLE was NFS.

A fatal signal can wake up a process in TASK_KILLABLE but not in TASK_UNINTERRUPTIBLE.

Does a fatal signal mean only SIGKILL, or also SIGTERM, SIGHUP, SIGQUIT, SIGINT, or ...?

8

Most signals are fatal by default. Any signal listed with a default action of “terminate” or “dump core” is fatal, unless it’s ignored or handled explicitly. This includes such “benign” signals as SIGUSR1, as well as SIGKILL of course, SIGTERM etc.

This matches the Linux kernel’s definition of fatal signals; for a signal to be fatal:

Thus a fatal signal is one which would result in the process being killed (without going through a handler specified by the program being run).

  • 1
    I assume SIGKILL is a fatal signal, but which other signals could be considered as such? – nxnev Dec 24 '18 at 22:54
  • Thanks. (1) "the ignored signals (from the kernel’s perspective)". Most signals can be ignored. But the first link you gave shows some specific signals, such as SIGCONT, SIGCHLD, SIGWINCH, and SIGURG. So what does "ignored" signal mean? (2) The first link you gave doesn't say anything like "a fatal signal is one which would result in the process being killed (without going through a handler specified by the program being run)". Can we derive that from the definition in the first quote? – Tim Dec 25 '18 at 6:03
  • @nxnev any signal not listed as an ignored or stop signal is fatal by default. – Stephen Kitt Dec 25 '18 at 8:35
  • (1) It means that the kernel ignores them in this context, not that they’re configured as ignored signals. (Note that the list is static.) (2) The two bullet points retranscribe the code definition; that’s how we can derive the meaning of “fatal signal”. – Stephen Kitt Dec 25 '18 at 8:37
  • Thanks. Fatal signals are defined in terms of default actions, and by set complement (not ignore, not stop or contonue, then only terminate and core) – Tim Dec 25 '18 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.