From deee290c395f241a78723d05d621bedbf5bfa33d Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Fri, 10 Mar 2017 17:48:48 +0000 Subject: [PATCH] Remove special stack handling for test 2 - no longer needed. --- RunTest | 93 +++++++++++++++++---------------------------------------- 1 file changed, 28 insertions(+), 65 deletions(-) diff --git a/RunTest b/RunTest index 49e099b..f5b388b 100755 --- a/RunTest +++ b/RunTest @@ -308,27 +308,14 @@ if [ $link_size -gt 4 ] ; then exit 1 fi -# If it is possible to set the system stack size, arrange to set a value for -# test 2, which needs more than the even the Linux default when PCRE2 has been -# compiled by gcc with -fsanitize=address. If "bigstack" is on the command -# line, set even bigger numbers. When the compiler is clang, sanitize options -# require an even bigger stack for test 2, and an increased stack for some of -# the other tests. Test 2 now has code to automatically try again with a 64M -# stack if it crashes when test2stack is "-S 16" when matching with the -# interpreter. +# If it is possible to set the system stack size and -bigstack was given, +# set up a large stack. $sim ./pcre2test -S 1 /dev/null /dev/null -if [ $? -eq 0 ] ; then - if [ "$bigstack" = "" ] ; then - test2stack="-S 16" - defaultstack="" - else - test2stack="-S 1024" - defaultstack="-S 64" - fi +if [ $? -eq 0 -a "$bigstack" != "" ] ; then + setstack="-S 16" else - test2stack="" - defaultstack="" + setstack="" fi # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only @@ -490,7 +477,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do1 = yes ] ; then echo $title1 for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput1 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput1 testtry checkresult $? 1 "$opt" done fi @@ -500,34 +487,10 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do2 = yes ] ; then echo $title2 "(excluding UTF-$bits)" for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $test2stack $bmode $opt $testdata/testinput2 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry if [ $? = 0 ] ; then $sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -63,-62,-2,-1,0,100,188,189,190,191 >>testtry checkresult $? 2 "$opt" - else - echo " " - echo "** Test 2, when run under the interpreter, requires a lot of stack." - echo "** If it has crashed with a segmentation fault, it may be that you" - echo "** do not have enough stack available by default. Please see the" - echo "** 'pcre2stack' man page for a discussion of PCRE2's stack usage." - if [ "$test2stack" != "-S 16" -o "$opt" != "" ]; then - echo " " - exit 1 - fi - echo " " - echo "** Trying again with an increased stack size." - echo " " - echo $title2 "(excluding UTF-$bits) (64M stack)" - $sim $valgrind ${opt:+$vjs} ./pcre2test -q -S 64 $bmode $opt $testdata/testinput2 testtry - if [ $? = 0 ] ; then - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -63,-62,-2,-1,0,100,188,189,190,191 >>testtry - checkresult $? 2 "$opt" - else - echo " " - echo "** Failed with an increased stack size. Tests abandoned." - echo " " - exit 1 - fi fi done fi @@ -577,7 +540,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ "$locale" != "" ] ; then echo $title3 "(using '$locale' locale)" for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $infile testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $infile testtry if [ $? = 0 ] ; then case "$opt" in -jit) with=" with JIT";; @@ -614,7 +577,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because UTF-$bits support is not available" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput4 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput4 testtry checkresult $? 4 "$opt" done fi @@ -626,7 +589,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because UTF-$bits support is not available" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput5 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput5 testtry checkresult $? 5 "$opt" done fi @@ -636,7 +599,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do6 = yes ] ; then echo $title6 - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput6 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput6 testtry checkresult $? 6 "" fi @@ -645,7 +608,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $utf -eq 0 ] ; then echo " Skipped because UTF-$bits support is not available" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput7 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput7 testtry checkresult $? 7 "" fi fi @@ -663,7 +626,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $utf -eq 0 ] ; then echo " Skipped because UTF-$bits support is not available" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput8 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput8 testtry checkresult $? 8-$bits-$link_size "" fi fi @@ -676,7 +639,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped when running 16/32-bit tests" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput9 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput9 testtry checkresult $? 9 "$opt" done fi @@ -692,7 +655,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because UTF-$bits support is not available" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput10 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput10 testtry checkresult $? 10 "$opt" done fi @@ -706,7 +669,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped when running 8-bit tests" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput11 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput11 testtry checkresult $? 11-$bits "$opt" done fi @@ -723,7 +686,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because UTF-$bits support is not available" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput12 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput12 testtry checkresult $? 12-$bits "$opt" done fi @@ -736,7 +699,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ "$bits" = "8" ] ; then echo " Skipped when running 8-bit tests" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput13 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput13 testtry checkresult $? 13 "" fi fi @@ -748,7 +711,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $utf -eq 0 ] ; then echo " Skipped because UTF-$bits support is not available" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput14 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput14 testtry checkresult $? 14-$bits "" fi fi @@ -757,7 +720,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do15 = yes ] ; then echo $title15 - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput15 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput15 testtry checkresult $? 15 "" fi @@ -768,7 +731,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $jit -ne 0 ] ; then echo " Skipped because JIT is available" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput16 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput16 testtry checkresult $? 16 "" fi fi @@ -780,7 +743,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then echo " Skipped because JIT is not available or nojit was specified" else - $sim $valgrind $vjs ./pcre2test -q $defaultstack $bmode $testdata/testinput17 testtry + $sim $valgrind $vjs ./pcre2test -q $setstack $bmode $testdata/testinput17 testtry checkresult $? 17 "" fi fi @@ -792,7 +755,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ "$bits" = "16" -o "$bits" = "32" ] ; then echo " Skipped when running 16/32-bit tests" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput18 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput18 testtry checkresult $? 18 "" fi fi @@ -806,7 +769,7 @@ for bmode in "$test8" "$test16" "$test32"; do elif [ $utf -eq 0 ] ; then echo " Skipped because UTF-$bits support is not available" else - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput19 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput19 testtry checkresult $? 19 "" fi fi @@ -815,7 +778,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do20 = yes ] ; then echo $title20 - $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput20 testtry + $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput20 testtry checkresult $? 20 "" fi @@ -827,7 +790,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because \C is disabled" else for opt in "" $jitopt -dfa; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput21 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput21 testtry checkresult $? 21 "$opt" done fi @@ -843,7 +806,7 @@ for bmode in "$test8" "$test16" "$test32"; do echo " Skipped because UTF-$bits support is not available" else for opt in "" $jitopt; do - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput22 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput22 testtry checkresult $? 22-$bits "$opt" done fi @@ -856,7 +819,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $supportBSC -ne 0 ] ; then echo " Skipped because \C is not disabled" else - $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput23 testtry + $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput23 testtry checkresult $? 23 "" fi fi