This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47296] I/O Segfault when running out of file descriptors


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]