summaryrefslogtreecommitdiff
path: root/tests/pcre-jitstack
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2015-11-01 15:38:23 -0800
committerJim Meyering <meyering@fb.com>2015-11-01 15:38:23 -0800
commit3e24e1d86b4ccc53094208d599c8347716bda9c8 (patch)
treefa339cb696d77cd65dd6c1c2da2bcd3dcf4eedc1 /tests/pcre-jitstack
parentda9cf47e2769053576daf1e2998a39bc9885c27d (diff)
downloadgrep-3e24e1d86b4ccc53094208d599c8347716bda9c8.tar.gz
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
Diffstat (limited to 'tests/pcre-jitstack')
-rwxr-xr-xtests/pcre-jitstack15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/pcre-jitstack b/tests/pcre-jitstack
index 03587f1a..d9a56158 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