From owner-freebsd-hackers Thu Nov 13 15:44:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA04095 for hackers-outgoing; Thu, 13 Nov 1997 15:44:32 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from kithrup.com (kithrup.com [205.179.156.40]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA04083 for ; Thu, 13 Nov 1997 15:44:16 -0800 (PST) (envelope-from sef@kithrup.com) Received: (from sef@localhost) by kithrup.com (8.8.7/8.8.7) id PAA04605 for hackers@freebsd.org; Thu, 13 Nov 1997 15:44:15 -0800 (PST) (envelope-from sef) Date: Thu, 13 Nov 1997 15:44:15 -0800 (PST) From: Sean Eric Fagan Message-Id: <199711132344.PAA04605@kithrup.com> To: hackers@freebsd.org Subject: Re: unkillable process Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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.