autoconf-patches
[Top][All Lists]
Advanced

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

Re: replace autom4te output file atomically


From: Ralf Wildenhues
Subject: Re: replace autom4te output file atomically
Date: Wed, 20 Aug 2008 21:19:29 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Ben Pfaff wrote on Tue, Aug 19, 2008 at 11:24:32PM CEST:
> Ralf Wildenhues <address@hidden> writes:
> 
> > I'm stumbling over the testsuite failure though (and wondering
> > slightly if this can in any way be a destabilizing change).
> 
> On what kind of a system was this testsuite failure observed?  I
> would like to fix the problem before we proceed.  I did test, but
> only on Debian GNU/Linux "sid", x86-32, with bash 3.1.17.

Debian lenny on x86, with m4 1.4.11 locally compiled and installed.
To reproduce it, all you need is a few tries and a file system with
one second granularity.

Passing --force to autom4te fixes the race, but uncovers more issues
with the test.  The patch below, on top of yours, fixes the test in the
sense that it passes.  However, it passes with or without your
bin/autom4te.in change: when m4 is interrupted during its expansion
stage, it is writing to a file below the $tmp temporary directory, not
to the output file.  That doesn't mean there is no race to fix, just
that the race happens after m4 runs.

As I wrote earlier, it is really not easy to expose the interrupt
race in a testsuite test.  I wouldn't know how to do it.  Consequently
I'm wondering whether to drop the test completely.

The only other questions I ask myself wrt. Ben's patch is: when autoconf
is interrupted by SIGQUIT (C-\) or KILL, then temporary files may build
up.  Maybe this should be mentioned in the manual somewhere (just to be
safe against user complaints later)?  Also, the amound of free space
needed for one autoconf rerun increases now by one configure script
size, but that's more of a theoretical question.

Thoughts?

Cheers,
Ralf

diff --git a/tests/tools.at b/tests/tools.at
index f3b29b6..8e432cb 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -220,10 +220,13 @@ AT_DATA([file],
 [[right
 ]])
 AT_DATA([file.m4],
-[[m4@&address@hidden([kill $PPID])
-wrong
+[[this is wrong, and should not appear in atomic output
+m4@&address@hidden([kill $PPID])
+this should never be evaluated
 ]])
-AT_CHECK_AUTOM4TE([-o file file.m4])
+dnl need --force, because input and output may have the same time stamp.
+dnl autom4te should exit with 128 + SIGTERM on Posix systems.
+AT_CHECK_AUTOM4TE([--language=m4sh --force -o file file.m4 || exit 1], [1], 
[], [ignore])
 
 AT_CHECK([cat file], 0,
 [[right




reply via email to

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