Under Linux, I have a process that is blocked in uninterruptible sleep (state D). How can I investigate what's causing this?
I am running an “ordinary” kernel (a Debian build), without any special debugging features.
There is no relevant log entry — in fact nothing got logged between the time the process started and the time I noticed it.
strace can't even attach to the process since it's in uninterruptible sleep. And even if I knew what system call was called, that wouldn't necessarily help me. I need to know what's going on inside the kernel.
sync command goes into uninterruptible sleep :( So I must have an I/O problem somewhere but all my filesystems appear to work normally. There may well be an old log entry about an I/O error but I can't find it (this machine hasn't rebooted in a long time, that's a lot of log entries). Can I at least know which subsystem is blocking
sync? For example, get a kernel backtrace for the kernel thread corresponding to a particular PID/TID?
(I'm sure that rebooting would either fix this or reveal the error but I'm asking how to investigate this, not how to blindly press a button.)