[ltp] Immortal process that does not let the computer to sleep.

Richard Neill linux-thinkpad@linux-thinkpad.org
Wed, 28 Dec 2005 10:47:44 +0000


Mike Kershaw wrote:
>>Some days ago I tried to 'cat' a file in the /proc system, but it didn't
>>work, the process hung and would not respond to a "kill -9". I tried
>>closing the terminal (it was inside Konsole) and restarting the X server,
>>but the process was still there. The real problem is I could not suspend
>>the computer, because of this process, it said something like: "Strange,
>>bash doesn't want to stop" (of course, the culprit was the 'cat' under
>>'bash'). So, at the end I had to reboot the computer to get rid of this
>>process.
> 
> 
> If the process is listed in 'ps' as state 'D' (and it sounds like it is,
> since kill -9 didn't make it die), then you can't do anything.  It's in
> uninterruptable IO sleep, forever.  You'll have to take an unclean
> shutdown to get rid of it, there is no way to kill it.
> 

I've seen this occur quite frequently. (eg mplayer with win32 codecs on
dodgy hardware), or if you inadvertently unplug a usb memory key without
unmounting it properly.  Furthermore, if one process is in this state,
running ps,top,or kill will put the ps/top/kill process into the same state!

However, the existence of such a state is surely a kernel bug?  Is there
anything that can be done to fix it?

Richard