Trouble killing processes in SysV/AT

Charles Hedrick hedrick at athos.rutgers.edu
Sat Apr 30 11:45:25 AEST 1988


You ask about processes that refuse to die.  (Calling them "immortal"
confers a positive aura that is probably undeserved.  Normally these
processes are in a useless state, and might better be referred to as
members of the "undead".)  Unix, along with many other operating
systems, kills processes by telling them to die.  You probably
envision that kill -9 invokes some code that goes through all the
tables ripping out entries for the process.  Unfortunately, the kernel
isn't organized in such a way that this is possible.  Processes may
own resources, locks, mapped memory, etc.  All of these have to be
released validly before the process can safely be removed from the
system.  Thus a kill starts a surprisingly complex series of events,
some of which are executed in the process' own context.  If the
process is in an inconsistent state, it may be unable to complete
these events, and hang in the process of being killed (or killing
itself).  I've seen this sort of thing happen in many different
versions of Unix (including various Berkeley-based Unices), and
similar things afflicted TOPS-20.  By definition it is caused by
a bug in the kernel, typically some sort of race condition or
deadly embrace.



More information about the Comp.unix.microport mailing list