PCH merge: bootstrap failure, gengtype consumes all file descriptors

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Jun 10 20:01:00 GMT 2002

 > From: Geoff Keating <geoffk@geoffk.org>
 > > From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
 > > 
 > > I've been getting bootstrap failures in stage1 on solaris2.7 when
 > > running gengtype, it says:
 > > 
 > >  > opening output file: Too many open files
 > ...
 > > fds open	after call
 > > --------------------------
 > > 3		(prior to open_base_files)
 > > 12		open_base_files
 > > 29		write_gc_types
 > Yes.  What you're seeing is that there are a large number of output
 > files; they get opened as they are needed, but not closed until
 > processing is complete.
 > One reason they aren't closed is that gengtype uses tmpfile(), so it
 > can't close and re-open them because it doesn't know where they are.

It's common practice for sysadmins to lower the FD limit to 64 or 32
on multiuser systems with lots of login accounts so no one user hogs
resources.  I don't want to get superfluous gcc bug reports about

IMHO its system programming 101 that says don't open tons of FDs
simultaneously.  Instead do your processing one FD (file) at a time.

Can gengtype.c be changed so that we operate on only one of its output
files at a time so as not to consume so many file descriptors?

Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Solutions

More information about the Gcc-bugs mailing list