processes with eternal life ?

Randolph J. Herber, CD/DCD/SP, x2966 HERBER at FNALA.FNAL.GOV
Wed Mar 6 06:57:19 AEST 1991


>Date: Tue, 5 Mar 91 18:26:50 PST
>From: Stefan Farestam <farestam at orion.cerfacs.fr>
>Message-Id: <9103060226.AA15459 at ultima.cerfacs.fr>
>To: info-iris at BRL.MIL
>Subject: processes with eternal life ?
>
>
>   I have a process which refuses to be killed. It is a piece of
>   graphics code running on a 4D25TG under IRIX 3.3.1. The window
>   comes up and then dies. Afterwards it is impossible to kill
>   the process (both as a normal user and the super-user). If I
>   reboot the machine, then these processes disappears, but that
>   is a somewhat awkward manoeuvre just to get rid of a process !
>
>      Any suggestions or insights ?
>
>   Thanks,
>          Stefan Farestam

All that kill() or the kernel equivalent does is set a bit in p_sig bit map in
the process' process block.  And, if the process is running on a another
processor, a hardware inter-CPU interrupt is sent to that processor.  The
actual signal processing does not occur until that process is being dispatched
to user state again.  At that time the signal (the bit in p_sig) may be
ignored, default actioned or control given to a signal handler in the user
code (with changes being made to the stack to call the signal handler and if
it returns, re-enter the kernel to support a return to the original point of
interrupt in the user code.)  If the process never comes to point of dispatch
to user state, the process does not terminate.

If a process is waiting at priority above priority PZERO, it will not be
woke up when a signal is presented, not even for uid 0, root.  Usually
this condition occurs when a process is waiting for the completion of an I/O
operation.  The reason for this behavior is that the process has system
critical resources locked that as the kernel is currently structured will only
be released when the current operation completes.  Most kernels do not have
the necessary coding that would release the locked resources if a process was
just interrupted and terminated anywhere in the kernel.  If a process is
waiting below priority PZERO in the kernel, the system call is terminated with
errno 4, EINTR, and the process is marked runnable.  In this case, the process
will in time be dispatched and signal processing done.

This is another Frequently Asked Question.

Randolph J. Herber, herber at fnalf.fnal.gov



More information about the Comp.sys.sgi mailing list