From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 6 08:42:24 2006 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47C4216A4EB for ; Thu, 6 Jul 2006 08:42:24 +0000 (UTC) (envelope-from ohki@gssm.otsuka.tsukuba.ac.jp) Received: from utogwpl.gssm.otsuka.tsukuba.ac.jp (utogwpl.gssm.otsuka.tsukuba.ac.jp [210.154.96.162]) by mx1.FreeBSD.org (Postfix) with SMTP id B49A143D67 for ; Thu, 6 Jul 2006 08:42:22 +0000 (GMT) (envelope-from ohki@gssm.otsuka.tsukuba.ac.jp) Received: (qmail 70729 invoked from network); 6 Jul 2006 08:42:20 -0000 Received: from OneOfLocalMachines (HELO smr00.gssm.otsuka.tsukuba.ac.jp) (10.2.1.1) by 10.1.1.1 with SMTP; 6 Jul 2006 08:42:20 -0000 Received: from gssm.otsuka.tsukuba.ac.jp (localhost [127.0.0.1]) by smr00.gssm.otsuka.tsukuba.ac.jp (8.13.3/8.13.3) with ESMTP id k668gK2I021382; Thu, 6 Jul 2006 17:42:20 +0900 (JST) (envelope-from ohki@gssm.otsuka.tsukuba.ac.jp) Message-Id: <200607060842.k668gK2I021382@smr00.gssm.otsuka.tsukuba.ac.jp> From: Atsuo Ohki To: Robert Watson In-reply-to: Your message of "Wed, 05 Jul 2006 12:08:54 +0100" References: <200607040242.k642g6BG099462@www.freebsd.org> <20060705120748.F18236@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain;charset="US-ASCII" Date: Thu, 06 Jul 2006 17:42:20 +0900 Sender: ohki@gssm.otsuka.tsukuba.ac.jp Cc: freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/99758: chown/chmod pty slave side in kernel X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2006 08:42:24 -0000 Robert Watson writes: > ... > The tty_pts implementation in 7-CURRENT does the same, except more so, by > forcing revocation of the pty on last close. Unfortunately, this triggers > bugs in devfs. Your help in getting the 7.x pts implementation up and runnin > g > would be much appreciated. Take a look at src/sys/kern/tty_pts.c. Thank you for interested in my patch. I don't have a machine to run 7-current now, so just read `src/sys/kern/tty_pts.c'. Is make_dev()/destroy_dev() problem specific to pts implementaition? What happens when destroy_devl() of src/sys/kern/kern_conf.c is modified as --- kern_conf.c Thu Jul 6 17:11:27 2006 +++ kern_conf.c Thu Jul 6 17:38:51 2006 @@ -682,6 +682,10 @@ } dev->si_flags &= ~SI_ALIAS; + if (dev->si_refcount == 0 && dev->si_priv->cdp_inuse > 0) { + /* devfs_populate_loop() will free this cdev structure */ + dev->si_refcount++; + } if (dev->si_refcount > 0) { LIST_INSERT_HEAD(&dead_cdevsw.d_devs, dev, si_list); } else { I suspect the situation that the cdev structure is freed while it is referred to by devfs.