Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 13:06:26 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Dieter BSD <dieterbsd@gmail.com>
Subject:   Re: Running 8 building 10 gives "Out of file descriptors" ?
Message-ID:  <20141119210626.GT24601@funkthat.com>
In-Reply-To: <1416365518.1147.84.camel@revolution.hippie.lan>
References:  <CAA3ZYrBJajkeV-wO8CWHo3TODjHDt=qkiCniU%2BT07%2BNjvyid3A@mail.gmail.com> <1416365518.1147.84.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141119210626.GT24601>