From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 4 22:01:46 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F21BB16A585 for ; Thu, 4 Jan 2007 22:01:46 +0000 (UTC) (envelope-from zombyfork@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.224]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1C313C448 for ; Thu, 4 Jan 2007 22:01:46 +0000 (UTC) (envelope-from zombyfork@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so6396863wxc for ; Thu, 04 Jan 2007 14:01:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=AqvqhB5bQBATA7kqdJMWQcTIVVhjYwBa3men7Ni93iaxuEzdJDFhsCoiCyTfx0Ek1Z6+eaS+W1+2P1JhL7vcwgSEC/jlmNF9cQNhRfpNk/i7cSbN/dV+loIaPzHqKnd8Z1Rhh0MG9A1vRLSHRA75D8NJMQg0HaRonsGrymL+/+k= Received: by 10.90.93.6 with SMTP id q6mr550789agb.1167946456621; Thu, 04 Jan 2007 13:34:16 -0800 (PST) Received: by 10.90.101.15 with HTTP; Thu, 4 Jan 2007 13:34:16 -0800 (PST) Message-ID: <346a80220701041334x484380a6n4d8d7a575d8fc659@mail.gmail.com> Date: Thu, 4 Jan 2007 14:34:16 -0700 From: "Coleman Kane" To: "Ed Schouten" In-Reply-To: <20070104204952.GT1072@hoeg.nl> MIME-Version: 1.0 References: <20070104201434.GS1072@hoeg.nl> <20070104204952.GT1072@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Hackers , philippe.lang@attiksystem.ch, bug-followup@freebsd.org Subject: Re: kern/89528: [jail] impossible to kill a jail X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: cokane@cokane.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2007 22:01:47 -0000 On 1/4/07, Ed Schouten wrote: > > * Ed Schouten wrote: > > As long as pty's have been allocated that have been created by threads > > in a jail, the prison structure has more references, causing the zombie > > jails to exist. > > We could change the make_dev_credv() routine to crcopy() everything > except the prison when we're creating a node in a jail. The following > patch fixes the zombie jail bug on my machine: > > --- src/sys/kern/kern_conf.c Fri Oct 20 09:59:50 2006 > +++ src/sys/kern/kern_conf.c Thu Jan 4 21:36:44 2007 > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -563,7 +564,15 @@ > > dev->si_flags |= SI_NAMED; > if (cr != NULL) > - dev->si_cred = crhold(cr); > + if (cr->cr_prison == NULL) { > + dev->si_cred = crhold(cr); > + } else { > + /* Don't let the node depend on a prison */ > + dev->si_cred = crget(); > + crcopy(dev->si_cred, cr); > + prison_free(dev->si_cred->cr_prison); > + dev->si_cred->cr_prison = NULL; > + } > else > dev->si_cred = NULL; > dev->si_uid = uid; > > Could other people experiencing this problem as well give this patch a > try? Thanks a lot! > > Yours, > -- > Ed Schouten > WWW: http://g-rave.nl/ > > > Does this behavior still occur if you set sysctl kern.pts.enable=1 ? Is this at all related to why I have been experiencing zombies left behind for any process that alloc's its own tty (such as gnome-terminal [actually gnome-pty-helper])? If I CTRL-D to end a gnome-terminal session, it will hang all of the gnome-terminals I have open and I typically have to reboot to clear out the zombies that remain. I can't open any more apps that use gnome-pty-helper to allocate ttys unless I attempt to kill it and start it anew (and I am not even completely sure if that works). -- Coleman Kane