Tough nuts for "kill -9" (was Re: [vox-tech] ac97 sound problems)

Jeff Newmiller vox-tech@lists.lugod.org
Thu, 25 Apr 2002 15:27:52 -0700 (PDT)


On Thu, 25 Apr 2002 msimons@moria.simons-clan.com wrote:

> On Thu, Apr 25, 2002 at 12:36:02PM -0700, Jeff Newmiller wrote:
> > On Thu, 25 Apr 2002, Peter Jay Salzman wrote:
> > > begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com> 
> > > >   If you send a "kill -9" and the process does not die instantly, then 
> > > > you have a kernel bug... there is no way to "block" or "hide" from 
> > > > kill -9.
> > 
> > The process may also be a zombie... this has been discussed on this list
> > and is a Unix FAQ ...
> 
>   Heh, zombie "processes" are already dead, which is why they can not be
> killed.  On Linux all of their resources are released and they only occupy a 
> few pages of memory for process state and return code, until their parent
> calls wait on them (which "buries" them).

I know, and you know, but this is not intuitively obvious to someone who
doesn't know, so it is worth mentioning BEFORE concluding that they are
dealing with kernel bugs.

> 
>   It's true that you can send them -9 and they will still appear in ps.
> 
>     Later,
>       Mike
> 
> ... in another bold statement all processes become zombies just after
> they exit.  unless _maybe_ you are on a SMP machine... except maybe
> init, and all those those pesky kernel threads...  ;)

When a process exits its parent may be waiting for it.  I don't have time
(and no guarantee I can succeed when I do) to dig into the kernel and see
if this case is recognized and optimized out, but I would hope it
is.

> (I'm actually not certain of implementation, it could be that the kernel
> may suspend the process that exits, before cleaning up after it and flaging 
> it as a Z state, to signal the parent... but that seems messy.)

Something to look at sometime...

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------