autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.66-21-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.66-21-gfbd1b9e
Date: Wed, 21 Jul 2010 04:18:25 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=fbd1b9e4fb6a1983bdb1eff3f8d34f8ee62cd6ea

The branch, master has been updated
       via  fbd1b9e4fb6a1983bdb1eff3f8d34f8ee62cd6ea (commit)
       via  97ecc667f76f29369b3a4cbfdde2c61d5f0e131f (commit)
      from  82f7cdadbbde10fa0b4ff11ce0311857258a08de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fbd1b9e4fb6a1983bdb1eff3f8d34f8ee62cd6ea
Author: Eric Blake <address@hidden>
Date:   Tue Jul 20 22:11:14 2010 -0600

    Close job control fd before running tests.
    
    * doc/autoconf.texi (File Descriptors): Clarify limitations.
    * lib/autotest/general.m4 (AT_CLEANUP): Avoid leaking job control
    fifo fd to user tests.
    (AT_INIT): Delete comment, now that close is done elsewhere.
    Suggested by Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 97ecc667f76f29369b3a4cbfdde2c61d5f0e131f
Author: Eric Blake <address@hidden>
Date:   Tue Jul 20 21:14:14 2010 -0600

    Plug race in parallel autotest.
    
    * lib/autotest/general.m4 (AT_INIT) <Fifo job dispatcher>: Track
    two fds to fifo in parent, to avoid race where parent can see EOF
    before child opens fifo.  Avoid any atomicity problems with tokens
    larger than one byte.
    * NEWS: Document the bug fix.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   19 +++++++++++++++++++
 NEWS                    |    5 +++++
 doc/autoconf.texi       |    8 +++++++-
 lib/autotest/general.m4 |   31 +++++++++++++++++++++----------
 4 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1a62089..2544b76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2010-07-20  Eric Blake  <address@hidden>
 
+       Close job control fd before running tests.
+       * doc/autoconf.texi (File Descriptors): Clarify limitations.
+       * lib/autotest/general.m4 (AT_CLEANUP): Avoid leaking job control
+       fifo fd to user tests.
+       (AT_INIT): Delete comment, now that close is done elsewhere.
+       Suggested by Ralf Wildenhues.
+
+2010-07-20 Paul Eggert  <address@hidden>
+       and Eric Blake  <address@hidden>
+
+       Plug race in parallel autotest.
+       * lib/autotest/general.m4 (AT_INIT) <Fifo job dispatcher>: Track
+       two fds to fifo in parent, to avoid race where parent can see EOF
+       before child opens fifo.  Avoid any atomicity problems with tokens
+       larger than one byte.
+       * NEWS: Document the bug fix.
+
+2010-07-20  Eric Blake  <address@hidden>
+
        Another empty argument through expr workaround.
        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Detect empty
        arguments.  Reject empty file argument.
diff --git a/NEWS b/NEWS
index e8fcd3d..e2ae2a7 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,11 @@ GNU Autoconf NEWS - User visible changes.
 
 ** autoreconf passes warning flags to new enough versions of aclocal.
 
+** Running an Autotest testsuite in parallel mode no longer triggers a
+   race condition that could cause the testsuite run to end early,
+   fixing a sporadic failure in autoconf's own testsuite.  Bug present
+   since introduction of parallel tests in 2.63b.
+
 
 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
   Released by Eric Blake, based on git versions 2.65.*.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index c47d510..c3a8714 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15006,7 +15006,7 @@ $
 Within the process which runs the @samp{descrips} script, file
 descriptor 5 is closed.
 
-Don't rely on redirection to a closed file descriptor to cause an
+Don't rely on duplicating a closed file descriptor to cause an
 error.  With Solaris @command{/bin/sh}, when the redirection fails, the
 output goes to the original file descriptor.
 
@@ -15019,6 +15019,12 @@ hi
 0
 @end example
 
+Fortunately, an attempt to close an already closed file descriptor will
+portably succeed.  Likewise, it is safe to use either style of
address@hidden@var{n}<&-} or @address@hidden>&-} for closing a file descriptor,
+even if it doesn't match the read/write mode that the file descriptor
+was opened with.
+
 DOS variants cannot rename or remove open files, such as in
 @samp{mv foo bar >foo} or @samp{rm foo >foo}, even though this is
 perfectly portable among Posix hosts.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index e27d601..4acdb9d 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -959,7 +959,10 @@ export PATH
 
 # Setting up the FDs.
 m4_define([AS_MESSAGE_LOG_FD], [5])
-m4_define([AT_JOB_FIFO_FD], [6])
+dnl The parent needs two fds to the same fifo, otherwise, there is a race
+dnl where the parent can read the fifo before a child opens it for writing
+m4_define([AT_JOB_FIFO_IN_FD], [6])
+m4_define([AT_JOB_FIFO_OUT_FD], [7])
 [#] AS_MESSAGE_LOG_FD is the log file.  Not to be overwritten if `-d'.
 if $at_debug_p; then
   at_suite_log=/dev/null
@@ -1376,7 +1379,14 @@ dnl avoid all the status output by the shell.
     (
       # Start one test group.
       $at_job_control_off
-      exec AT_JOB_FIFO_FD>"$at_job_fifo"
+dnl First child must open the fifo to avoid blocking parent; all other
+dnl children inherit it already opened from the parent.
+      if $at_first; then
+       exec AT_JOB_FIFO_OUT_FD>"$at_job_fifo"
+      else
+dnl Children do not need parent's copy of fifo.
+       exec AT_JOB_FIFO_IN_FD<&-
+      fi
 dnl When a child receives PIPE, be sure to write back the token,
 dnl so the master does not hang waiting for it.
 dnl errexit and xtrace should not be set in this shell instance,
@@ -1386,7 +1396,7 @@ dnl optimize away the _AT_CHECK subshell, so normalize 
here.
 dnl Ignore PIPE signals that stem from writing back the token.
            trap "" PIPE
            echo stop > "$at_stop_file"
-           echo token >&AT_JOB_FIFO_FD
+           echo >&AT_JOB_FIFO_OUT_FD
 dnl Do not reraise the default PIPE handler.
 dnl It wreaks havoc with ksh, see above.
 dnl        trap - 13
@@ -1395,26 +1405,27 @@ dnl         kill -13 $$
       at_fn_group_prepare
       if cd "$at_group_dir" &&
         at_fn_test $at_group &&
-        . "$at_test_source" # AT_JOB_FIFO_FD>&-
+        . "$at_test_source"
       then :; else
        AS_WARN([unable to parse test group: $at_group])
        at_failed=:
       fi
       at_fn_group_postprocess
-      echo token >&AT_JOB_FIFO_FD
+      echo >&AT_JOB_FIFO_OUT_FD
     ) &
     $at_job_control_off
     if $at_first; then
       at_first=false
-      exec AT_JOB_FIFO_FD<"$at_job_fifo"
+      exec AT_JOB_FIFO_IN_FD<"$at_job_fifo" AT_JOB_FIFO_OUT_FD>"$at_job_fifo"
     fi
     shift # Consume one token.
     if test address@hidden:@] -gt 0; then :; else
-      read at_token <&AT_JOB_FIFO_FD || break
+      read at_token <&AT_JOB_FIFO_IN_FD || break
       set x $[*]
     fi
     test -f "$at_stop_file" && break
   done
+  exec AT_JOB_FIFO_OUT_FD>&-
   # Read back the remaining ($at_jobs - 1) tokens.
   set X $at_joblist
   shift
@@ -1423,9 +1434,9 @@ dnl           kill -13 $$
     for at_job
     do
       read at_token
-    done <&AT_JOB_FIFO_FD
+    done <&AT_JOB_FIFO_IN_FD
   fi
-  exec AT_JOB_FIFO_FD<&-
+  exec AT_JOB_FIFO_IN_FD<&-
   wait
 else
   # Run serially, avoid forks and other potential surprises.
@@ -1906,7 +1917,7 @@ echo "#                             -*- compilation -*-" 
>> "$at_group_log"
 m4_undivert([TEST_SCRIPT])dnl Insert the code here
   set +x
   $at_times_p && times >"$at_times_file"
-) AS_MESSAGE_LOG_FD>&1 2>&1 | eval $at_tee_pipe
+) AS_MESSAGE_LOG_FD>&1 2>&1 AT_JOB_FIFO_OUT_FD>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
 [#AT_STOP_]AT_ordinal
 m4_divert_pop([TEST_GROUPS])dnl Back to KILL.


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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