Subject: Re: bug#10374: 3 test failures on fedora 16

From: Stefano Lattarini <[email-masked]>
Date: Tue, 27 Dec 2011 10:41:53 +0100

On 12/26/2011 11:26 PM, Jim Meyering wrote:
> FAIL: cond29
> ============
> 
> Running from installcheck: no
> Using TAP: no
> PATH = /h/j/w/co/automake/tests:/opt/cov-sa-linux64-5.4.0/bin:/usr/lib64/ccache:/h/j/bin/perl:/h/j/bin:/p/p/git/bin:/p/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local:/usr/local/bin
> ++ pwd
> /h/j/w/co/automake/tests/cond29.dir
> + echo AC_PROG_CC
> + cat
> + ulimit -v 1
> + sh -c :
> ./cond29.test: line 35: /bin/sh: Argument list too long
> + ulimit -v 20000
> + sh -c :
> + ulimit -v 20000
> + 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
> + unindent
> + test x = x
> ++ printf '%s\n' '
>   /^$/b                    # Nothing to do for empty lines.
>   x                        # Get x<indent> into pattern space.
>   /^$/{                    # No prior x<indent>, go prepare it.
>     g                      # Copy this 1st non-blank line into pattern space.
>     s/^\([	 ]*\).*/x\1/   # Prepare x<indent> in pattern space.
>   }                        # Now: x<indent> in pattern and <line> in hold.
>   G                        # Build x<indent>\n<line> in pattern space, and
>   h                        # duplicate it into hold space.
>   s/\n.*$//                # Restore x<indent> in pattern space, and
>   x                        # exchange with the above duplicate in hold space.
>   s/^x\(.*\)\n\1//         # Remove leading <indent> from <line>.
>   s/^x.*\n//               # Restore <line> when there is no leading <indent>.
> '
> ++ sed -e 's/  *# .*//'
> + sed_unindent_prog='
>   /^$/b
>   x
>   /^$/{
>     g
>     s/^\([	 ]*\).*/x\1/
>   }
>   G
>   h
>   s/\n.*$//
>   x
>   s/^x\(.*\)\n\1//
>   s/^x.*\n//'
> + sed '
>   /^$/b
>   x
>   /^$/{
>     g
>     s/^\([	 ]*\).*/x\1/
>   }
>   G
>   h
>   s/\n.*$//
>   x
>   s/^x\(.*\)\n\1//
>   s/^x.*\n//'
> + echo 'AM_CONDITIONAL([C01], [:])'
> + 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
>
[SNIP repeated traces]
>
> + 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
> + unindent
> + test 'x
>   /^$/b
>   x
>   /^$/{
>     g
>     s/^\([	 ]*\).*/x\1/
>   }
>   G
>   h
>   s/\n.*$//
>   x
>   s/^x\(.*\)\n\1//
>   s/^x.*\n//' = x
> + sed '
>   /^$/b
>   x
>   /^$/{
>     g
>     s/^\([	 ]*\).*/x\1/
>   }
>   G
>   h
>   s/\n.*$//
>   x
>   s/^x\(.*\)\n\1//
>   s/^x.*\n//'
> + echo 'AM_CONDITIONAL([C22], [:])'
> + aclocal-1.11a -Werror
> /usr/bin/perl: error while loading shared libraries: 
>   libc.so.6: failed to map segment from shared object:
>   Cannot allocate memory
>
Ah-ah, memory ulimit contraints imposed by ulimit above:

  ulimit -v 20000

seems to be too tight.  I can reproduce a similar failure on the Fedora
16 system (on pcc64 machine) at the GCC compile farm, and fix it with
the attached patch.  Does that patch works for you as well?

> + exit_status=127
> + set +e
> + cd /h/j/w/co/automake/tests
> + test no = yes
> + case $am_explicit_skips in
> + test 127 -eq 0
> + keep_testdirs=yes
> + am_keeping_testdirs
> + case $keep_testdirs in
> + return 0
> + set +x
> cond29: exit 127
> 

Thanks,
  Stefano
>From 073711d00759683895805b31fd6dad76d2c26aec Mon Sep 17 00:00:00 2001
Message-Id: <073711d00[email-masked]>
From: Stefano Lattarini <[email-masked]>
Date: Tue, 27 Dec 2011 10:40:57 +0100
Subject: [PATCH] tests: fix spurious failure of cond29.test

* tests/cond29.test: Limit the amount of virtual memory available
to the automake process to ~ 50 MB, rather than only ~ 20 MB, to
account for higher (but still acceptable) memory usages on some
systems (in this case, a Fedora 16 distro on ppc64).  To be
sure not to reduce coverage, increase the number of potential
combinations of automake conditionals from 2**22 = 4194304 to
2**24 = 16777216.

Reported by Jim Meyering in automake bug#10374.
---
 ChangeLog         |   12 ++++++++++++
 tests/cond29.test |   14 +++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dfe666a..8f332ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-12-27  Stefano Lattarini  <[email-masked]>
+
+	tests: fix spurious failure of cond29.test
+	* tests/cond29.test: Limit the amount of virtual memory available
+	to the automake process to ~ 50 MB, rather than only ~ 20 MB, to
+	account for higher (but still acceptable) memory usages on some
+	systems (in this case, a Fedora 16 distro on ppc64).  To be
+	sure not to reduce coverage, increase the number of potential
+	combinations of automake conditionals from 2**22 = 4194304 to
+	2**24 = 16777216.
+	Reported by Jim Meyering in automake bug#10374.
+
 2011-12-24  Stefano Lattarini  <[email-masked]>
 
 	gitignore: use only one .gitignore file, in the top-level directory
diff --git a/tests/cond29.test b/tests/cond29.test
index 3361081..3971c08 100755
--- a/tests/cond29.test
+++ b/tests/cond29.test
@@ -27,16 +27,20 @@ a02_LDADD =
 a03_SOURCES =
 EOF
 
-# On this test, Automake 1.7.x would compute all 2**22 = 4194304
+# On this test, Automake 1.7.x would compute all 2**24 = 16777216
 # 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 1; sh -c ":") && skip_ "no adequate 'ulimit' builtin found"
-(ulimit -v 20000; sh -c ":") || skip_ "no adequate 'ulimit' builtin found"
-ulimit -v 20000
-
-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
+(ulimit -v 50000; sh -c ":") || skip_ "no adequate 'ulimit' builtin found"
+ulimit -v 50000
+
+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 23 24
+do
   unindent >>Makefile.am <<EOF
     if C$i
     bin_PROGRAMS += a$i
-- 
1.7.7.3