From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 21:06:29 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF2CB8F3; Wed, 19 Nov 2014 21:06:29 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9228838D; Wed, 19 Nov 2014 21:06:28 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sAJL6Re2081699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Nov 2014 13:06:27 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sAJL6RHA081698; Wed, 19 Nov 2014 13:06:27 -0800 (PST) (envelope-from jmg) Date: Wed, 19 Nov 2014 13:06:26 -0800 From: John-Mark Gurney To: Ian Lepore Subject: Re: Running 8 building 10 gives "Out of file descriptors" ? Message-ID: <20141119210626.GT24601@funkthat.com> Mail-Followup-To: Ian Lepore , Dieter BSD , freebsd-hackers@freebsd.org References: <1416365518.1147.84.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1416365518.1147.84.camel@revolution.hippie.lan> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 19 Nov 2014 13:06:27 -0800 (PST) Cc: freebsd-hackers@freebsd.org, Dieter BSD 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 21:06:29 -0000 Ian Lepore wrote this message on Tue, Nov 18, 2014 at 19:51 -0700: > 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. ktrace+kdump can give you the return value of fcntl... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."