This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: PCH merge: bootstrap failure, gengtype consumes all file descriptors
- From: Geoff Keating <geoffk at geoffk dot org>
- To: ghazi at caip dot rutgers dot edu
- Cc: gcc-bugs at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Mon, 10 Jun 2002 14:17:08 -0700
- Subject: Re: PCH merge: bootstrap failure, gengtype consumes all file descriptors
- References: <200206102044.QAA16742@caip.rutgers.edu>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
> Date: Mon, 10 Jun 2002 16:44:27 -0400 (EDT)
> From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
> Cc: gcc-bugs@gcc.gnu.org, gcc@gcc.gnu.org
>
> 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.
> (And BTW the return value is not checked so we don't know we got an
> error.)
Actually, it is:
f = tmpfile();
if (f == NULL)
{
perror ("couldn't create temporary file");
exit (1);
}
I suspect that if you get the error you quoted, it really does mean that
you were only one FD short.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>