From owner-freebsd-current@FreeBSD.ORG Sat Dec 27 06:01:35 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61D1616A4CE for ; Sat, 27 Dec 2003 06:01:35 -0800 (PST) Received: from transport.cksoft.de (transport.cksoft.de [62.111.66.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A09743D2F for ; Sat, 27 Dec 2003 06:01:32 -0800 (PST) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from transport.cksoft.de (localhost [127.0.0.1]) by transport.cksoft.de (Postfix) with ESMTP id BA0901FF91D; Sat, 27 Dec 2003 15:01:30 +0100 (CET) Received: by transport.cksoft.de (Postfix, from userid 66) id 18DD11FF90C; Sat, 27 Dec 2003 15:01:29 +0100 (CET) Received: by mail.int.zabbadoz.net (Postfix, from userid 1060) id A2840154E5; Sat, 27 Dec 2003 14:01:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.int.zabbadoz.net (Postfix) with ESMTP id A015B153EB; Sat, 27 Dec 2003 14:01:21 +0000 (UTC) Date: Sat, 27 Dec 2003 14:01:21 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@e0-0.zab2.int.zabbadoz.net To: Oliver Brandmueller In-Reply-To: <20031227132932.GA86308@e-Gitt.NET> Message-ID: References: <20031227123148.GB77531@e-Gitt.NET> <200312271253.aa04019@salmon.maths.tcd.ie> <20031227132932.GA86308@e-Gitt.NET> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS cksoft-s20020300-20031204bz on transport.cksoft.de cc: freebsd-current@freebsd.org Subject: Re: file descriptor leak in 5.2-RC X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2003 14:01:35 -0000 On Sat, 27 Dec 2003, Oliver Brandmueller wrote: > Hi. > > On Sat, Dec 27, 2003 at 12:53:20PM +0000, David Malone wrote: > > Hmmm - could be... The following patch to fstat prints the data > > field for inodes in fstat's output. I'd suggest: > > > > 1) Run until you have alot of the same inode stuck open. > > 2) Run pstat -f and get the data value. > > 3) Run fstat and grep for the data value in question. > > > > You might need to do 3 a few times, depending on how long the phantom > > inode is actually open for while the program is running. I wonder > > if it is some sort of device cloning/refcounting problem? > > It's /dev/null ! > > lupin# pstat -f > 2779/262144 open files > LOC TYPE FLG CNT MSG DATA OFFSET > c7effd8c pipe RW 2 0 c7968560 0 > c7a9d880 pipe RW 3 0 c789a35c 0 > c7fbadd0 inode RW 1 0 c72fae38 0 > c7aea374 inode RW 1 0 c72fae38 0 > c7fbad8c inode RW 1 0 c72fae38 0 > c7f9f550 inode RW 1 0 c72fae38 0 > c7fba61c inode RW 1 0 c72fae38 0 > [...] > > lupin# fstat | fgrep c72fae38 | head -20 > vscan perl 8817 0 0xc72fae38 /dev 8 crw-rw-rw- null r > vscan perl 8817 1 0xc72fae38 /dev 8 crw-rw-rw- null w > vscan perl 8817 2 0xc72fae38 /dev 8 crw-rw-rw- null w > vscan perl 8718 0 0xc72fae38 /dev 8 crw-rw-rw- null r > vscan perl 8718 1 0xc72fae38 /dev 8 crw-rw-rw- null w > vscan perl 8718 2 0xc72fae38 /dev 8 crw-rw-rw- null w when daemonizing you open /dev/null and dup2 it to 0,1,2 to detach from stdin,out,err. -- Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT 56 69 73 69 74 http://www.zabbadoz.net/