autoconf-patches
[Top][All Lists]
Advanced

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

race condition in autom4te


From: Ralf Wildenhues
Subject: race condition in autom4te
Date: Fri, 12 Jun 2009 13:40:14 +0200
User-agent: Mutt/1.5.19 (2009-06-09)

Hi Eric,

I've had my lucky day today in hitting this race condition out in the
wild on a HP-UX 10.20 system:

> 29. tools.at:1017: testing ...
> ../../autoconf/tests/tools.at:1023: echo AC_INIT | autom4te 
> --language=autoconf -o configure
> 0a1
> > autom4te: cannot create autom4te.cache: File exists
> ../../autoconf/tests/tools.at:1023: exit code was 1, expected 0
> 29. tools.at:1017: 29. autom4te cache locking (tools.at:1017): FAILED 
> (tools.at:1023)

I haven't been able to reproduce this any more than this one time, with
lots of tries.  Anyway, it is fixed easily, and I've pushed this patch
below.

Cheers,
Ralf

    Fix concurrent autom4te.cache directory creation race.
    
    * bin/autom4te.in: Do not error out if another `autom4te'
    instance created the cache directory before we could.

diff --git a/bin/autom4te.in b/bin/autom4te.in
index 471b165..cf425bb 100644
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -972,10 +972,11 @@ if ($freeze)
     exit $exit_code;
   }
 
-# We need our cache directory.
+# We need our cache directory.  Don't fail with parallel creation.
 if (! -d "$cache")
   {
     mkdir "$cache", 0755
+      or -d "$cache"
       or fatal "cannot create $cache: $!";
   }
 




reply via email to

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