Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 1997 15:44:15 -0800 (PST)
From:      Sean Eric Fagan <sef@kithrup.com>
To:        hackers@freebsd.org
Subject:   Re: unkillable process
Message-ID:  <199711132344.PAA04605@kithrup.com>

next in thread | raw e-mail | index | archive | help
>I wrote:
>> 1. Create a named pipe
>> 2. Start typing into it using cat
>> 3. Hit control-C as many times as you want
>> 
>> You'll see that the process will not die even with kill -9,
>> as it is stuck in uninterrupible disk sleep ("fifo").
>
>According to sef, the problem is that the child (csh or tcsh
>but not sh) is ignoring SIGINT, the parent opens the file
>after vfork()'ing, and something else (now I forgot already).

My quick summary (I haven't dived into csh code yet) is that csh (and tcsh)
are doing:

	vfork()	-- parent sleeps uninterruptably until child exec's or exits
	signal(SIGINT, SIG_IGN); -- and other signals, presumably
	open("pipe", O_CREAT|O_TRUNC, ...)

At that piont, the child is asleep in fifo_open().  It is interruptable --
but SIGINT is ignored!  So are some other signals.

The parent is unkillable; it cannot be made killable, since a vfork'd parent
process is not really there -- the child is really it.  (This is a holdover
from the original implementation.)

I think the fix is going to be in csh and tcsh -- I don't think they should
be opening the file in teh child, but should only do it in the parent.

I'm waiting to hear from some other people as well.

Sean.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711132344.PAA04605>