From owner-freebsd-current@FreeBSD.ORG Sat Dec 20 03:45:42 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 D8A9916A4CE for ; Sat, 20 Dec 2003 03:45:42 -0800 (PST) Received: from prg.traveller.cz (prg.traveller.cz [193.85.2.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 097EE43D45 for ; Sat, 20 Dec 2003 03:45:41 -0800 (PST) (envelope-from mime@traveller.cz) Received: from prg.traveller.cz (localhost [127.0.0.1]) hBKBjL8Y090943; Sat, 20 Dec 2003 12:45:21 +0100 (CET) Received: from localhost (mime@localhost)hBKBjLNx090940; Sat, 20 Dec 2003 12:45:21 +0100 (CET) Date: Sat, 20 Dec 2003 12:45:20 +0100 (CET) From: Michal Mertl To: Kris Kennaway In-Reply-To: <20031220043852.GA67473@xor.obsecurity.org> Message-ID: <20031220123907.X90388@prg.traveller.cz> References: <20031217110353.U94352@prg.traveller.cz> <20031219112603.O37433@prg.traveller.cz> <20031220043852.GA67473@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Jonathan Lennox 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, 20 Dec 2003 11:45:43 -0000 > On Fri, Dec 19, 2003 at 11:30:40AM +0100, Michal Mertl wrote: > > On Thu, 18 Dec 2003, Jonathan Lennox wrote: > > > Michal Mertl writes: > > > > For several weeks now I see my -current (now RELENG_5_2 to help test the > > > > release) machine seems to be leaking file descriptors. After some time all > > > > files (up to kern.maxfiles) are consumed. > > > > > > Do you have any statically-linked programs that use pthreads? There's a FD > > > leak in gethostbyname(3) in multithreaded programs (actually, in the uthread > > > wrapper for kevent(2), but gethostbyname(3) is the most common reason you'd > > > see it) which was fixed in -CURRENT for programs linked with libc_r.so, but > > > not for those linked with libc_r.a. > > > > I'm afraid this is different. When your program terminates the descriptors > > are freed. You found a bug but it's not that serious as what I'm seeing - > > even when I go to single-user I see large openfiles. > > Someone else already asked you to check fstat to see what the open > files are, and suggested it's probably the dynamic linker > (i.e. expected behaviour). What is the case? As I already replied to Jonathan the output of fstat (and lsof) looks normal. After going to _single_user_ with no processess running, fstat shows only a handful of files (sh and fstat itself) yet kern.maxfiles is large. I thus suppose that the leak is in kernel. I think the leak is provoked by mozilla - when I leave my computer with mozilla running with page loaded which reloads itself every minute, after several hours the leak is obvious. After a weekend all descriptors are consumed and nothing short of reboots gives them back. -- Michal Mertl