[Bug fortran/47296] I/O Segfault when running out of file descriptors
jvdelisle at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jan 16 08:35:00 GMT 2011
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.
More information about the Gcc-bugs
mailing list