All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Felker <tfelker2@uiuc.edu>
To: gene.heskett@verizon.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: is killing zombies possible w/o a reboot?
Date: Wed, 3 Nov 2004 14:48:38 -0600	[thread overview]
Message-ID: <200411031448.38110.tfelker2@uiuc.edu> (raw)
In-Reply-To: <200411030751.39578.gene.heskett@verizon.net>

On Wednesday 03 November 2004 06:51 am, Gene Heskett wrote:
> Greetings;
>
> I thought I'd get caught up on -bkx kernels and made a -bk8 just now.
>
> But I'd tried to run gnomeradio earlier to listen to the elections,
> but it failed leaving to run, as did tvtime then too, claiming it
> couldn't get a lock on /dev/video0, and gnomeradio apparently left a
> lock on alsasound that prevented the normal gracefull shutdown by
> locking up the shutdown on the "stopping alsasound" line.  So I had
> to use the hardware reset.
>
> I'd tried to kill the zombie earlier but couldn't.
>
> Isn't there some way to clean up a &^$#^#@)_ zombie?

Ok, let me try to explain what probably happened.

First, terminology.  When one process wants to be come two processes, it 
fork()s.  One process is the parent, and one it the child.  The child usually 
exec()s to become a different program.  The parent sometimes wants to know 
when the child ends and whether it succeeded.  Thus, the wait() system calls.  
The parent can either check whether a child died, or go to sleep until one 
does.  When the parent is awaken, it's told which child died and what the 
child's exit status was (usually 0 for success).  But if the child dies 
before the parent wait()s, the kernel must keep a record of which child died 
and what its exit status was, and it can't reassign the late child's PID yet.  
This record is a "zombie," and shows up under top or ps with the 'Z' state.  
Zombies do _not_ hold open files, memory, or resources of any kind.

That's the technical definition of a zombie, which I'm telling you because 
that's probably not your situation:  I assume you used "zombie" as an 
informal term for a process that you can't kill.  Your problem is a process 
in uninterruptible sleep (the "D" state).

When a process executing in userspace wants information from a device, like a 
disk or TV capture card, it calls read(), and context switches into kernel 
space.  Usually, it will take a moment for the data to be available from the 
device, so the process gets put on a wait queue so other processes can run.  
Obviously nothing is deallocated, because everyone expects the process will 
get it's data and proceed as normal.  When the device has the data, it 
interrupts the CPU, and the kernel figures out who wanted the data and puts 
them on the run queue.

When a process is on a wait queue waiting for data from a device (the D 
state), it's impossible to kill.  This is because otherwise, when the 
interrupt did come, the structures associated with the process would have 
been freed, and the kernel would crash.  It would require an incredible 
amount of innefficient bookkeeping to avoid this, and it's unnecessary 
because normally, the data request will finish (successfully or not), and the 
process will be woken up, or if it was sent SIGKILL, it will be killed.

Long story short, what happened was, some faulty hardware or some buggy 
driver, probably associated with the capture card, had a problem and left the 
process in D state.  Thus, it couldn't be killed, and since it had /dev/video 
open, tvtime couldn't run and failed gracefully, and because it held /dev/dsp 
open, and couldn't be killed as the init scripts would normally do in that 
situation, the audio drivers couldn't be unloaded and the boot process hung.

So give us a bunch of information about what hardware you're using, output of 
dmesg, and steps to reproduce the driver bug (if it is that).
-- 
Tom Felker, <tcfelker@mtco.com>
<http://vlevel.sourceforge.net> - Stop fiddling with the volume knob.

If you have to design something and control freaks are involved, give them 
plenty of knobs, but don't connect them to anything important.

  parent reply	other threads:[~2004-11-03 20:55 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-03 12:51 is killing zombies possible w/o a reboot? Gene Heskett
2004-11-03 14:33 ` bert hubert
2004-11-03 14:49   ` Måns Rullgård
2004-11-03 15:25     ` DervishD
2004-11-03 15:25       ` Måns Rullgård
2004-11-03 17:49         ` DervishD
2004-11-03 16:47       ` Gene Heskett
2004-11-03 17:44         ` DervishD
2004-11-03 18:53           ` Gene Heskett
2004-11-03 19:01             ` Doug McNaught
2004-11-03 19:03             ` Måns Rullgård
2004-11-03 19:24               ` Gene Heskett
2004-11-03 19:33                 ` Doug McNaught
2004-11-03 19:34                 ` Måns Rullgård
2004-11-03 19:06             ` Valdis.Kletnieks
2004-11-03 19:26               ` Gene Heskett
2004-11-03 19:33                 ` Valdis.Kletnieks
2004-11-03 20:09                   ` Gene Heskett
2004-11-04 19:24                     ` Bill Davidsen
2004-11-03 19:42                 ` DervishD
2004-11-03 23:12                   ` Bill Davidsen
2004-11-04 10:26                     ` DervishD
2004-11-04 14:23                       ` Paul Slootman
2004-11-04 14:56                         ` Gene Heskett
2004-11-04 18:24                         ` DervishD
2004-11-04 19:22                       ` Bill Davidsen
2004-11-04 20:53                         ` DervishD
2004-11-03 19:26             ` DervishD
2004-11-03 20:18               ` Gene Heskett
2004-11-03 22:15               ` Jim Nelson
2004-11-03 22:44                 ` Russell Miller
2004-11-03 23:03                   ` Doug McNaught
2004-11-03 23:33                     ` Russell Miller
2004-11-03 23:47                       ` Mathieu Segaud
2004-11-03 23:56                         ` Russell Miller
2004-11-04  0:05                           ` Mathieu Segaud
2004-11-04  6:39                       ` Denis Vlasenko
2004-11-05  2:38                         ` Elladan
2004-11-05  3:10                           ` Tim Connors
2004-11-05  3:17                             ` Russell Miller
2004-11-05  4:38                             ` Elladan
2004-11-05  5:00                             ` Kyle Moffett
2004-11-04 20:06                       ` Bill Davidsen
2004-11-03 23:06                   ` vlobanov
2004-11-04 10:04                   ` Helge Hafting
2004-11-04 17:16                     ` Alex Bennee
2004-11-04 16:30                 ` Pedro Venda (SYSADM)
2004-11-04 22:28                   ` Helge Hafting
2004-11-03 23:07               ` Bill Davidsen
2004-11-04  1:19                 ` Michael Clark
2004-11-04 16:01         ` kernel
2004-11-04 16:18           ` Gene Heskett
2004-11-04 16:47             ` kernel
2004-11-04 17:58               ` Gene Heskett
2004-11-03 22:58       ` Bill Davidsen
2004-11-04 10:23         ` DervishD
2004-11-04 19:32           ` Bill Davidsen
2004-11-04 21:11             ` DervishD
2004-11-09 23:31               ` Bill Davidsen
2004-11-10  9:11                 ` DervishD
2004-11-03 23:18       ` Adam Heath
2004-11-03 16:38     ` Gene Heskett
2004-11-03 16:24   ` Gene Heskett
2004-11-03 16:46     ` linux-os
2004-11-03 19:12       ` Gene Heskett
2004-11-03 19:56       ` Måns Rullgård
2004-11-03 20:13     ` Helge Hafting
2004-11-03 20:40       ` Gene Heskett
2004-11-04  0:43         ` Kurt Wall
2004-11-04  1:01           ` Russell Miller
2004-11-04  1:38             ` Doug McNaught
2004-11-04  1:45               ` Russell Miller
2004-11-04  1:56                 ` Doug McNaught
2004-11-04  1:59                 ` Mitchell Blank Jr
2004-11-04 20:10                   ` Bill Davidsen
2004-11-04 10:07         ` Matthias Andree
2004-11-04 22:31           ` Peter Chubb
2004-11-04 23:33           ` Benno
2004-11-03 20:48 ` Tom Felker [this message]
2004-11-03 21:08   ` Gene Heskett
2004-11-04  7:19     ` Jan Knutar
2004-11-04 11:57       ` Gene Heskett
2004-11-04 12:12         ` Jan Knutar
2004-11-04 12:18           ` Gene Heskett
2004-11-04 12:29             ` Jan Knutar
2004-11-04 13:56               ` Gene Heskett
2004-11-04 12:39           ` Gene Heskett
2004-11-04 13:01             ` Ian Campbell
2004-11-04 14:07               ` Gene Heskett
2004-11-04 14:24                 ` Ian Campbell
2004-11-04 15:10                   ` Gene Heskett
2004-11-04 14:26                 ` DervishD
2004-11-04 15:13                   ` Gene Heskett
2004-11-04 13:10             ` Doug McNaught
2004-11-04 14:11               ` Gene Heskett
2004-11-04 14:42                 ` tlaurent
2004-11-04 15:14                   ` Gene Heskett
2004-11-04 20:18             ` Bill Davidsen
2004-11-05  0:29   ` Gene Heskett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200411031448.38110.tfelker2@uiuc.edu \
    --to=tfelker2@uiuc.edu \
    --cc=gene.heskett@verizon.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.