GNU bug report logs - #10470
MSYS: race in directory access?

Previous Next

Package: automake;

Reported by: Peter Rosin <peda <at> lysator.liu.se>

Date: Mon, 9 Jan 2012 23:09:01 UTC

Severity: minor

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 10470 <at> debbugs.gnu.org (full text, mbox):

From: Peter Rosin <peda <at> lysator.liu.se>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 10470 <at> debbugs.gnu.org
Subject: Re: bug#10470: MSYS: race in directory access?
Date: Tue, 10 Jan 2012 12:35:11 +0100
Peter Rosin skrev 2012-01-10 11:12:
> Stefano Lattarini skrev 2012-01-10 10:50:
>> [2] Now that I think of it, my knee-jerk guess is that the "( sleep 1 ) &"
>>     put in configure by AM_SANITY_CHECK is the likely culprit.
> 
> I tried that hypothesis and bumped this to "( sleep 2 ) &", and the test
> case failed even with my ugly "sleep 1" workaround.  I then bumped "my" fix
> to "sleep 2" and the test case succeeded again.  So they certainly seem
> connected.

One further data point; changing that "( sleep 1 ) &" thing followed by a
wait just before AC_OUTPUT into an inlined sleep also fixes the test case.

As below, but as before, one unconditional second might be too expensive.

So, your knee-jerk is sound.  Question is what to do...

Cheers,
Peter


diff --git a/m4/sanity.m4 b/m4/sanity.m4
index b718ac4..689781a 100644
--- a/m4/sanity.m4
+++ b/m4/sanity.m4
@@ -69,17 +69,8 @@ fi
 AC_MSG_RESULT([yes])
 # If we didn't sleep, we still need to ensure time stamps of config.status and
 # generated files are strictly newer.
-am_sleep_pid=
 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
-  ( sleep 1 ) &
-  am_sleep_pid=$!
+  sleep 1
 fi
-AC_CONFIG_COMMANDS_PRE(
-  [AC_MSG_CHECKING([that generated files are newer than configure])
-   if test -n "$am_sleep_pid"; then
-     # Hide warnings about reused PIDs.
-     wait $am_sleep_pid 2>/dev/null
-   fi
-   AC_MSG_RESULT([done])])
 rm -f conftest.file
 ])





This bug report was last modified 13 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.