From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 6 08:50:22 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB97F16A4DF for ; Thu, 6 Jul 2006 08:50:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47BA843D45 for ; Thu, 6 Jul 2006 08:50:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k668oMa1071211 for ; Thu, 6 Jul 2006 08:50:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k668oMXV071210; Thu, 6 Jul 2006 08:50:22 GMT (envelope-from gnats) Date: Thu, 6 Jul 2006 08:50:22 GMT Message-Id: <200607060850.k668oMXV071210@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Atsuo Ohki Cc: 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 Reply-To: Atsuo Ohki List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2006 08:50:22 -0000 The following reply was made to PR kern/99758; it has been noted by GNATS. From: Atsuo Ohki To: Robert Watson Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/99758: chown/chmod pty slave side in kernel Date: Thu, 06 Jul 2006 17:42:20 +0900 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.