This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47296] I/O Segfault when running out of file descriptors
- From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Jan 2011 08:30:15 +0000
- Subject: [Bug fortran/47296] I/O Segfault when running out of file descriptors
- Auto-submitted: auto-generated
- References: <bug-47296-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47296
--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-16 08:29:55 UTC ---
After getting Win7-cygwin build of gcc latest trunk built, I was able to do
some more testing. I could then reproduce another segfault. As Janne
suggested and I certainly agree, the following simple patch clears this second
segfault. It is interesting that the Windows/cygwin execution behaves
differently and the opp->file somewhere is getting touched or not initialized.
Index: unix.c
===================================================================
--- unix.c (revision 168844)
+++ unix.c (working copy)
@@ -1085,7 +1085,11 @@
#endif /* HAVE_MKSTEMP */
if (fd < 0)
- free (template);
+ {
+ free (template);
+ opp->file = NULL;
+ opp->file_len = 0;
+ }
else
{
opp->file = template;
I will commit this sometime tomorrow.