From 3e24e1d86b4ccc53094208d599c8347716bda9c8 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 1 Nov 2015 15:38:23 -0800 Subject: [PATCH] tests: pcre-jitstack: upon failure, retry with no stack size limit * tests/pcre-jitstack: Don't let an example that provokes inordinate stack space use cause a test failure. Thanks to reports from and analysis by Bruce Dubbs; see http://debbugs.gnu.org/21755 --- tests/pcre-jitstack | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/pcre-jitstack b/tests/pcre-jitstack index 03587f1..d9a5615 100755 --- a/tests/pcre-jitstack +++ b/tests/pcre-jitstack @@ -34,6 +34,19 @@ test $? -eq 0 || framework_failure_ gzip -d pcrejit.txt || framework_failure_ LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt -test $? -eq 1 || fail=1 +if test $? != 1; then + # The above often makes grep attempt to use an inordinate amount + # of stack space. If grep fails with $? != 1, try gain, but this + # time with no soft limit: + + # Use ulimit to remove that limit, if possible. + # If ulimit is not usable, just skip this test. + (ulimit -s unlimited; : ) || skip_ this shell lacks ulimit support + + # Rerun that same test, but now with no limit on stack size: + (ulimit -s unlimited; + LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt) + test $? = 1 || fail=1 +fi Exit $fail -- 2.6.0