LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-11-2003, 05:22 PM   #1
webee
LQ Newbie
 
Registered: Jan 2003
Posts: 11

Rep: Reputation: 0
Process Status D


Hi:

What does the status D indicate when i run ps aux command?

If any process has status D (which i read means In disk or short term wait) is it something i should worry about?

I have an application written in C that sometimes gives me a seg fault. When I ran it with gdb, that process state is given as D.

Thanks for any input on this.
 
Old 02-11-2003, 05:28 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
If you weren't lazy you'd do basic
man ps
and search for STATE
Code:
PROCESS STATE CODES
       D   uninterruptible sleep (usually IO)
       R   runnable (on run queue)
       S   sleeping
       T   traced or stopped
       Z   a defunct ("zombie") process

       For BSD formats and when the "stat" keyword is used, additional letters may be displayed:
       W   has no resident pages
       <   high-priority process
       N   low-priority task
       L   has pages locked into memory (for real-time and custom IO)
 
Old 02-11-2003, 05:45 PM   #3
webee
LQ Newbie
 
Registered: Jan 2003
Posts: 11

Original Poster
Rep: Reputation: 0
Oh well. I have the Linux Administration Handbook and thought it was all I had to go on with. Thanks.
 
Old 02-11-2003, 06:07 PM   #4
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Quote:
Originally posted by neo77777
If you weren't lazy you'd do basic
man ps
ouch! I guess for a programmer or someone with any knowledge whatsover
Code:
   uninterruptible sleep (usually IO)
makes sense. But for me it doesn't. Could someone explain what that means, and more importantly, why I would even care whether something had a "D" on it or not?

Thank you And if it's in a man page somewhere, I'd be happy if you'd just point me towards it

Cool
 
Old 11-09-2003, 12:14 PM   #5
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
I had xcdroast fall into "uninterruptible sleep" when I tried to include files from a mounted hard drive in the list of files to copy to my new CD-DVD+R burner (which I can only use for CD burning as yet, not DVD).

I'd never knowingly seen the "D" status symbol before, and found out what it meant, could not kill the process by any means, finally rebooted; tried the experiment again--ended up rebooting three or four times. Searched on Google, found only that people seem to have to reboot and that the problem MAY be due to a deficiency in the kernel design. At which point I was in way further over my head than before. I'm afraid there's not much I can do to help with kernel design...

If anybody reads this and knows of a way to avoid rebooting when a process goes into uninterruptible sleep, please post!
 
Old 09-09-2004, 07:31 PM   #6
tim1235
Member
 
Registered: Aug 2004
Location: Melbourne, Australia
Distribution: fc5/Gentoo
Posts: 57

Rep: Reputation: 15
I have a similar problem:

I was trying to mount a flash stick and it failed leaving processes in an Uniteruptable sleep state (D)
I tried to kill them with "kill -9 PID", but to no avail,

The only way I have found to get rid of these is to reboot, so anyone with knowledge of how to get rid of these would be greatly appreciated
 
Old 10-21-2011, 07:59 AM   #7
rht7147
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
I also faced the same problems. But another behaviour i noticed that process used to switched between s(sleeping) & D state.

Quote:
Originally Posted by tim1235 View Post
I have a similar problem:

I was trying to mount a flash stick and it failed leaving processes in an Uniteruptable sleep state (D)
I tried to kill them with "kill -9 PID", but to no avail,

The only way I have found to get rid of these is to reboot, so anyone with knowledge of how to get rid of these would be greatly appreciated
 
Old 10-21-2011, 08:00 AM   #8
rht7147
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
I also faced the same problems. But another behaviour i noticed that process used to switched between s(sleeping) & D state.
 
Old 02-11-2013, 01:12 PM   #9
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
I know, this thread is old, but the initial question remained unresolved. Since I was looking for this information myself and this thread was the first hit on Google, I would like to quote the second-best hit here:

http://stackoverflow.com/questions/1...process-states
Quote:
While waiting for read() or write() to/from a file descriptor return, the process will be put in a special kind of sleep, known as "D" or "Disk Sleep". This is special, because the process can not be killed or interrupted while in such a state. A process waiting for a return from ioctl() would also be put to sleep in this manner.

An exception to this is when a file (such as a terminal or other character device) is opened in O_NONBLOCK mode, passed when its assumed that a device (such as a modem) will need time to initialize. However, you indicated block devices in your question. Also, I have never tried an ioctl() that is likely to block on a fd opened in non blocking mode (at least not knowingly).

How another process is chosen depends entirely on the scheduler you are using, as well as what other processes might have done to modify their weights within that scheduler.

Some user space programs under certain circumstances have been known to remain in this state forever, until rebooted. These are typically grouped in with other "zombies", but the term would not be correct as they are not technically defunct.
So unfortunately it does not tell me whether my perl script for indexing a 30G database is after 3 days still functioning or waiting for input that will never ever come.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 08:26 AM
about "Create Process", how to get the return status? iclinux Programming 2 01-12-2005 09:02 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 02:19 PM
child process -1 exited with status 1 ashfaq Linux - Software 3 04-09-2004 05:08 AM
ps (process status) command, PS_FORMAT how to set? alexander Linux - General 2 12-18-2002 04:38 AM


All times are GMT -5. The time now is 02:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration