From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 02:52:01 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DD1F622 for ; Wed, 19 Nov 2014 02:52:01 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224AEB0C for ; Wed, 19 Nov 2014 02:52:00 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XqvN9-000MfI-PV; Wed, 19 Nov 2014 02:51:59 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sAJ2pwGo007127; Tue, 18 Nov 2014 19:51:58 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1960yCz/Tpmui3qiVOstMCF X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: Running 8 building 10 gives "Out of file descriptors" ? From: Ian Lepore To: Dieter BSD In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Date: Tue, 18 Nov 2014 19:51:58 -0700 Message-ID: <1416365518.1147.84.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 02:52:01 -0000 On Tue, 2014-11-18 at 18:22 -0800, Dieter BSD wrote: > > I've been building 10.x and 11.x world and kernel from source on an 8.2 > > (and more recently now 8.4) system for a couple years, as recently as > > last night. I've never needed to do anything special. When I check > > sysctl kern.maxfiles it's set to 12328, not so different from yours. > > > > I wonder if some long-running process on your system is leaking away > > descriptors? A 'procstat -af' might help find that. > > Uptime is less than 3 days. (System hung a couple days ago, shutting off > the signal to the display. No core dump. No clues as to *why* it hung. > *grumble* ) > > >> getdtablesize() returned 11095 > > kern.maxfiles: 12328 > > # procstat -af | wc -l > 1912 > > I ran > while true ; do procstat -af | wc -l; sleep 0.03 ; done > in one window, and > make kernel-toolchain > in another window. Never got above 2000. Not absolute proof, but > it looks like it is not really running out of descriptors. > > chmod 0 /usr/bin/mkdep > gives the expected permission denied. (proves that it is trying to > run /usr/bin/mkdep) > > Restore the mode and change /usr/bin/mkdep to > #!/bin/sh > echo hello from mkdep > and I'm back to "Out of file descriptors". And it doesn't print hello. > > So... make (I assume?) thinks (incorrectly?) that it is running out of > file descriptors attempting to run /usr/bin/mkdep? Oh. Hrm. The only thing in the source that says that exact message is in /bin/sh input.c, and it looks like this: fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 10); close(fd); if (fd2 < 0) error("Out of file descriptors"); So you have guess what the actual error is, or hack the code to print errno or something. -- Ian