+2011-06-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: prefer ulimit over timeout in test on a memory-hogging bug
+ * tests/cond29.test: Use 'ulimit' instead of 'timeout' to ensure
+ that automake does not uses up too much resources. This is really
+ and improvement because the bug tested by this script wasn't just
+ a "it hangs" or "it runs too slow" bug, but rather a memory-hogging
+ bug (due to combinatorial explosion when many Automake conditionals
+ had to be handled) which could easily crash the whole system, which
+ is unacceptable. The requirement of a proper and working 'ulimit'
+ builtin might cause the test to be skipped on more systems, but
+ that shouldn't be a problem since the bug isn't about a portability
+ issue, but is rather an automake internal implementation problem.
+ I've verified that the test as updated by this patch still passes
+ with automake 1.8.5, automake 1.10.2, and obviously the development
+ version of automake, and that it fails with automake 1.7.9.
+
2011-06-01 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: avoid generating `*-p.test' tests, use a wrapper script
# Check that many conditions do not lead to combinatorial explosion.
# (This is related to PR/352.)
-#
-# On this test, Automake 1.7.x would compute all 2**22 = 4194304
-# possible combinations of conditionals (it would do this five times,
-# to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
-# a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
-# or cpu time it can found.
. ./defs || Exit 1
-timeout 10s true || skip_ "timeout command not found"
-
echo AC_PROG_CC >>configure.in
cat >Makefile.am <<EOF
a03_SOURCES =
EOF
+# On this test, Automake 1.7.x would compute all 2**22 = 4194304
+# possible combinations of conditionals (it would do this five times,
+# to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
+# a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
+# or cpu time it can found.
+ulimit -v 20000 || skip_ "no adequate 'ulimit' builtin found"
+(ulimit -v 1; sh -c 'exit 0') && skip_ "no adequate 'ulimit' builtin found"
+
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22; do
unindent >>Makefile.am <<EOF
if C$i
done
$ACLOCAL
-# Be lax w.r.t. the timeout for low-priority processes on heavily
-# loaded systems.
-niceness=`nice || echo 0`
-case $niceness in [0-9]*);; *) niceness=0;; esac
-timeout `expr 60 '+' $niceness '*' 20`s $AUTOMAKE
+$AUTOMAKE
: