Skip to contentSkip to conversation

How to diagnose a process stuck in D state?

DISCUSSION Daniel J Blueman 1 participant 1 message Feb 23, 2008

lore
Share & tools
lore
#0 lore raw

Stephen,

Quoted 16 lines · Stephen Oberholtzer

First off: I'm not subscribed to the list (I don't think I could handle the volume), so please make sure you CC me if you reply.

I run an application on one of my machines; it often hangs, with the process stuck D state. When this happens, the process sticks around until I reboot the machine.

I have tried the following to start diagnosing the problem:

* Running 'ps -axl' shows "-" in the wchan column.
* The contents of /proc/pid/wchan say "_stext".
* 'strace -p pid' says "Process pid attached - interrupt to quit" and stops responding. Sending SIGINT and SIGTERM have no effect on the strace process, although kill -11 (SIGSEGV, my personal favorite) does work.

Quoted 3 lines

This is very confusing. I would greatly appreciate it if someone could tell me how a process can enter D state without being in a syscall, and what I can do to start tracking down the cause.

wchan shows where the process is sleeping - probably a kernel mutex or lock here. This doesn't help much, but the stack signature will.

Enable and use the sys-request mechanism (via terminal, keyboard or serial) eg sysrq-T to dump the stack frames of all processes, including this.

Unsurprisingly, it's documented in the kernel Documentation directory.

Quoted 3 lines

(By the way: This is on amd64, 2.6.23. I'm updating to 2.6.24.2 right now, on the off chance that whatever was causing the problem has been fixed.)

Daniel

Signature · 1 line
Daniel J Blueman