bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test 52 failure on AIX, HP-UX, Solaris


From: Joel E. Denny
Subject: Re: Test 52 failure on AIX, HP-UX, Solaris
Date: Tue, 2 Feb 2010 01:19:38 -0500 (EST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Tue, 2 Feb 2010, Joel E. Denny wrote:

> On Mon, 1 Feb 2010, Albert Chin wrote:
> 
> > On Mon, Feb 01, 2010 at 06:56:03PM -0500, Joel E. Denny wrote:
> > > On Mon, 1 Feb 2010, Albert Chin wrote:
> > > 
> > > > Test 52 fails on AIX, HP-UX, and Solaris:
> > > > 52. output.at:159: testing ...
> > > > ./output.at:159: VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary 
> > > > --show-reachable=no"; export VALGRIND_OPTS; bison -o foo.y foo.y
> > > > 2c2,3
> > > > < 
> > > > ---
> > > > > /opt/TWWfsw/m414/bin/gm4:/opt/build/bison-2.4.1a/data/yacc.c:694: 
> > > > > ERROR: copying inserted file: Broken pipe
> > > > > /opt/TWWfsw/m414/bin/gm4: write error
> > > > 52. output.at:159: 52. Conflicting output files:  -o foo.y 
> > > > (output.at:159): FAILED (output.at:159)
> > > > 
> > > > We're seeing the same failure on AIX and HP-UX.
> > > 
> > > I'm pretty sure this means your m4 is broken.  Please confirm that you're 
> > > running at least GNU M4 1.4.6.
> > 
> > We're running 1.4.12.
> 
> You're saying that /opt/TWWfsw/m414/bin/gm4, which is mentioned in the 
> error message, is GNU M4 1.4.12?
> 
> I should point out that M4 in your environment would cause Bison to use a 
> different m4 than the one discovered by configure.

Never mind.  I think I see the problem now.  This test group produces a 
fatal error, which invokes exit, while the m4 subpipe is still open.  
Apparently that causes ugly error messages on some platforms.

We should probably change bison not to do this... and there are many other 
places where fatal errors might occur while the m4 subpipe is open.  For 
release 2.4.2, it might be better just to detect the problem and skip the 
associated test groups.  I'll have to give it more thought.

> Do any other test cases fail?  Attaching a complete tests/testsuite.log 
> and config.log might help us debug this.

That would still be helpful.

While the following patch is obviously not a good solution, would you 
please confirm that it does allow the test group to pass on the affected 
platforms?

diff --git a/src/files.c b/src/files.c
index 9761de9..63c9e2a 100644
--- a/src/files.c
+++ b/src/files.c
@@ -350,11 +350,15 @@ compute_output_file_names (void)
   free (header_extension);
 }
 
-void
+bool
 output_file_name_check (char const *file_name)
 {
   if (0 == strcmp (file_name, grammar_file))
-    fatal (_("refusing to overwrite the input file %s"), quote (file_name));
+    {
+      complain (_("fatal error: refusing to overwrite the input file %s"),
+                quote (file_name));
+      return true;
+    }
   {
     int i;
     for (i = 0; i < file_names_count; i++)
@@ -363,6 +367,7 @@ output_file_name_check (char const *file_name)
   }
   file_names = xnrealloc (file_names, ++file_names_count, sizeof *file_names);
   file_names[file_names_count-1] = xstrdup (file_name);
+  return false;
 }
 
 void
diff --git a/src/files.h b/src/files.h
index e8f28bf..5e114bf 100644
--- a/src/files.h
+++ b/src/files.h
@@ -63,7 +63,7 @@ extern char *all_but_ext;
 
 void compute_output_file_names (void);
 void output_file_names_free (void);
-void output_file_name_check (char const *file_name);
+bool output_file_name_check (char const *file_name);
 
 FILE *xfopen (const char *name, const char *mode);
 void xfclose (FILE *ptr);
diff --git a/src/scan-skel.l b/src/scan-skel.l
index 90a52dd..92cab2a 100644
--- a/src/scan-skel.l
+++ b/src/scan-skel.l
@@ -276,8 +276,10 @@ void at_directive_perform (int at_directive_argc,
           xfclose (yyout);
         }
       *outnamep = xstrdup (at_directive_argv[1]);
-      output_file_name_check (*outnamep);
-      yyout = xfopen (*outnamep, "w");
+      if (output_file_name_check (*outnamep))
+        yyout = xfopen ("bogus.tmp", "w");
+      else
+        yyout = xfopen (*outnamep, "w");
       *out_linenop = 1;
     }
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]