Running 8 building 10 gives "Out of file descriptors" ?

Ian Lepore ian at FreeBSD.org
Tue Nov 18 21:29:15 UTC 2014


On Tue, 2014-11-18 at 12:08 -0800, Dieter BSD wrote:
> amd64 running 8.2
> Attempting to update to 10.1
> Need to build custom 10.1 kernel on machine running 8.2.
> Installed binaries and src off to the side.
> Attempts to compile kernel directly failed.
> Attempts to build 10.1 "make" as 8.2 binary failed.
> Chroot to 10.1 tree.
> Attempt to build kernel (using stock GENERIC config file and stock sources
> for now) failed:
> 
> >>> stage 3.1: making dependencies
> --------------------------------------------------------------
> cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=amd64 \
>  MACHINE=amd64  CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin  GR\
> OFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH\
> =/usr/obj/usr/src/tmp/legacy/usr/share/tmac  _SHLIBDIRPREFIX=/usr/obj/usr/src/t\
> mp  _LDSCRIPTROOT=  VERSION="FreeBSD 10.1-RELEASE amd64 1001000"  INSTALL="sh /\
> usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/u\
> sr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/sr\
> c/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/us\
> r/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin CC="cc " CXX="c++ "  \
> CPP="cpp "  AS="as" AR="ar" LD="ld" NM=nm  OBJDUMP= RANLIB=ranlib STRINGS= COMP\
> ILER_TYPE=clang make  -m /usr/src/share/mk  KERNEL=kernel depend -DNO_MODULES_O\
> BJ
> machine -> /usr/src/sys/amd64/include
> x86 -> /usr/src/sys/x86/include
> cc  -c -O2 -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnes\
> ted-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -\
> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs\
>  -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-bod\
> y -Wno-error-parentheses-equality -Wno-error-unused-function -nostdinc -I. -I/u\
> sr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/s\
> rc/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/dev/ath/at\
> h_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/dev/cx\
> gb -I/usr/src/sys/dev/cxgbe -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERN\
> EL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-\
> frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse\
>  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector \
> -gdwarf-2 /usr/src/sys/amd64/amd64/genassym.c
> NM='nm' sh /usr/src/sys/kern/genassym.sh genassym.o > assym.s
> Out of file descriptors
> *** Error code 2
> 
> 
> Maybe I need to build the 10.1 toolchain as 8.2 binaries?
> nice -20 make kernel-toolchain > /tmp/make_kernel_toolchain_out 2>&1
> Result:
> mkdep -f .depend -a    -I/usr/src/tools/build/../../contrib/libc-pwcache -I/usr\
> /src/tools/build/../../lib/libc/include -I/usr/obj/usr/src/tmp/legacy/usr/inclu\
> de -std=gnu99   /usr/src/tools/build/../../contrib/libc-pwcache/pwcache.c
> Out of file descriptors
> 
> Wrote a very small C program.  Result:
> getdtablesize() returned 11095
> 
> The 10.1 mkdep is the same as 8.2 except for comments.
> 
> It seems unlikely that it really needs more than 11095 file descriptors.
> So what is going on, and how do I fix it?
> 
> [ Obviously I have thought of booting stock 10.1 and then building
> new kernel, but I can't take the machine down that long. ]

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.

-- Ian




More information about the freebsd-hackers mailing list