If a linux process is waiting for I/O (i.e it is in SLEEP
state) and a SIGKILL
signal is issued against it, upon termination (STOPPED
In addition to jim mcnamara's answer:
SIGKILL (kill -9) cannot be handled.
See the answer at https://stackoverflow.com/a/2541618/1456519 for more.
Signal are "handed off" to a process by the kernel, so sending a signal from processA to processB employs the kernel. When SIGKILL is delivered the kernel does not allow any activity by the process (user mode), specifically process rundown: atexit calls, _exit. Nothing. The process is simply destroyed by the system. This involves some activity in kernel mode. Buffered data is lost. SYSV semaphores and other kernel persistent memory objects are left in memory. It can be a real mess.
If something in kernel memory is causing a hang you use the sysrq interface in linux:
http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/security-sysrq.html
--to perform whatever semblance of an ordered shutdown you can get.
This is why using SIGKILL is an absolute last resort, because you cannot know what you are breaking. And it will not fix all hangs.
What exactly are you working on?