From 461bbb0f4a91212a3b8fdfc051b9795b9b668bb18e3b2500c8f43ea2506de804 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 18 Feb 2019 09:24:00 +0000 Subject: [PATCH] Accepting request 676970 from home:Andreas_Schwab:Factory - test-pcre-jitstack.diff: avoid false positive upon stack overflow OBS-URL: https://build.opensuse.org/request/show/676970 OBS-URL: https://build.opensuse.org/package/show/Base:System/grep?expand=0&rev=93 --- grep.changes | 5 +++++ grep.spec | 2 ++ test-pcre-jitstack.diff | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 test-pcre-jitstack.diff diff --git a/grep.changes b/grep.changes index eca51f6..6cc170f 100644 --- a/grep.changes +++ b/grep.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 18 08:57:22 UTC 2019 - schwab@suse.de + +- test-pcre-jitstack.diff: avoid false positive upon stack overflow + ------------------------------------------------------------------- Mon Jan 7 11:53:21 UTC 2019 - schwab@suse.de diff --git a/grep.spec b/grep.spec index aac82e3..98dc93c 100644 --- a/grep.spec +++ b/grep.spec @@ -26,6 +26,7 @@ Url: https://www.gnu.org/software/grep/ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source2: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source3: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=grep&download=1#/%{name}.keyring +Patch0: test-pcre-jitstack.diff BuildRequires: fdupes BuildRequires: makeinfo BuildRequires: pcre-devel @@ -42,6 +43,7 @@ match to a specified pattern. By default, grep prints the matching lines. %prep %setup -q +%patch0 -p1 %build %configure \ diff --git a/test-pcre-jitstack.diff b/test-pcre-jitstack.diff new file mode 100644 index 0000000..e567c69 --- /dev/null +++ b/test-pcre-jitstack.diff @@ -0,0 +1,32 @@ +From 64d7da63575bc6cb0bbcf7ac5ed81d51ea2a3a74 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Sun, 17 Feb 2019 17:47:30 -0800 +Subject: [PATCH] tests: avoid false positive upon stack overflow + +* tests/pcre-jitstack: Don't let a stack overflow evoke a false +failure. This test is to ensure there is no internal PCRE error. +Reported by Andres Schwab in http://bugs.gnu.org/34370 +--- + tests/pcre-jitstack | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/pcre-jitstack b/tests/pcre-jitstack +index a6c9c21..8f738f0 100755 +--- a/tests/pcre-jitstack ++++ b/tests/pcre-jitstack +@@ -52,8 +52,11 @@ if test $? != 1; then + + # Rerun that same test, but now with no limit on stack size: + (ulimit -s unlimited; +- returns_ 1 env LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt) \ ++ returns_ 1 env LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt 2> err) \ + || fail=1 ++ ++ # If that failed due to stack overflow, don't cry foul. ++ test $fail = 1 && grep -q 'stack overflow' err && fail=0 + fi + + Exit $fail +-- +2.20.1.2.gb21ebb671b +