LinuxQuestions.org
Help answer threads with 0 replies.
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: 56
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
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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: Ubuntu
Posts: 3,517

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.
Old 05-13-2016, 12:02 PM   #10
heatfanjohn
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Rep: Reputation: Disabled
Cool

FYI, you can use the iostat command to see if I/O is happening. If there isn't any I/O going on then I would say that the "D" process is probably never going to complete. If there is I/O going on then it could be for the process that is in a "D" status.

I had a command in a "D" status that was unpacking a dep package. iostat on another terminal showed that my I/O device was running very slow (hundreds of milliseconds of service and await time).

The command finally finished.
 
Old 05-13-2016, 04:20 PM   #11
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
There's something terribly amusingly ironic about a necrobump on a thread about uninterruptible sleeping processes.
 
1 members found this post helpful.
Old 06-06-2019, 01:23 AM   #12
speedfixer
LQ Newbie
 
Registered: Nov 2018
Distribution: Lubuntu 16.04
Posts: 3

Rep: Reputation: Disabled
Searched and found this as best hint at what is happening.

Old, but relevant.

A particular compile process on my 3B+ PI goes into 'D' state. Several minutes, then comes out with job completed. So ... D can be a valid state.
Sadly, this is a tiny header only test compile, not a real program yet.

Still no explanation. My guess: in my case, lots of I/O and file locks in a terribly slow system.
The clocks and timers all still ticking.
When the system has to do its work, my process goes into this protected wait so it won't get terminated.



david
 
Old 07-08-2019, 05:03 PM   #13
Stumbling
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Rep: Reputation: Disabled
Thanks

had the D status show up on writing to and SD card, something that should have been 15 minutes was taking over an hour plus.
The iostat command at least showed me that the card was being written too, however slowly. like .7 kb/s
Anyhow, the process did complete after about 2 hours.

Thanks for the tips!
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration