In some cases, or some conditions, you may find out that an application becomes inresponsive, and strangly, it doesn't pick up signals such Ctrl-C, SIGKILL,SIGSTOP etc..

You may wonder, what can I do to wake up the process, or can I kill it without reboot the server ?

Here are some scenarios that you may want to know before you do further actions:

A process in TASK_INTERRUPTIBLE process state

Under this process state, the process is suspended(sleeping). It must wait until a given event occurs without being interrupted. For instance, this state may be used when a process opens a device file and the corresponding device driver starts probing for a corresponding hardware device. The device driver must not be interrupted until the probing is complete, or the hardware device could be left in an unpredictable state.

At this process state, you will find 'D' shows in State field, here is a top output example:

 PID USER   PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   20 root  20   0     0    0    0 S  0.3  0.0   0:00.47 events/1
   61 root  39  19     0    0    0 S  0.3  0.0   0:00.11 khugepaged
 3855 root  20   0     0    0    0 S  0.3  0.0   0:02.83 kondemand/3
16933 root  18  -2  8316  560  484 D  0.3  0.0   0:00.16 blkid

At this process state, non of signals can be delivered to the process, including SIGKILL and SIGSTOP signals which cannot be ignored, caught,or blocked.

The only thing you can do is to find out which device or resource the processing is waiting for, make it available, then the process will become TASK_RUNNING again.

A process in EXIT_ZOMBIE process state

Also called defunct process, usually the process execution is terminated, but the parent proess has not yet issued a wait4() or waitpid() system call to return information about the dead process.

At this process state, in most cases, the only way to get rid of it is to reboot the server. No signal can be delivered to the process.

A process in signal blocked

Signal handling is vulnerable to race conditions. As signals are asynchronous, another signal (even of the same type) can be delivered to the process during execution of the signal handling routine.

The sigprocmask() call can be used to block and unblock delivery of signals. Blocked signals are not delivered to the process until unblocked.

Note:Signals that cannot be ignored (SIGKILL and SIGSTOP) cannot be blocked.

 

For more info about Linux process state, see Process state in linux kernel