summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-11-29 18:55:30 (GMT)
committerJim Meyering <meyering@fb.com>2016-11-29 19:00:55 (GMT)
commitae3f57c99c3c7b89cc15448a3365e71795a1a21b (patch)
treed4be2cb58962c8bfb4d5a0abe9a0fa424ec493a4
parentb7c4caec669d18ac7c5a692c10da7ddcc0e1f2a5 (diff)
downloadgrep-ae3f57c99c3c7b89cc15448a3365e71795a1a21b.zip
grep-ae3f57c99c3c7b89cc15448a3365e71795a1a21b.tar.gz
grep-ae3f57c99c3c7b89cc15448a3365e71795a1a21b.tar.bz2
grep: fix DFA-induced infloop
* gnulib: Update to latest, for the DFA infloop fix. * tests/dfa-infloop: New test, to trigger an infinite loop in the DFA matcher. * tests/Makefile.am (TESTS): Add it.
m---------gnulib0
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/dfa-infloop12
3 files changed, 13 insertions, 0 deletions
diff --git a/gnulib b/gnulib
-Subproject 9cba42f87e1e88ac746e2341c51e78f9f640fef
+Subproject ca3ca77fc9e497ff5048a9f1ee0d1acc8e050f5
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 442e85a..3ded7a7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -85,6 +85,7 @@ TESTS = \
count-newline \
dfa-coverage \
dfa-heap-overrun \
+ dfa-infloop \
dfaexec-multibyte \
empty \
empty-line \
diff --git a/tests/dfa-infloop b/tests/dfa-infloop
new file mode 100755
index 0000000..e35eef5
--- /dev/null
+++ b/tests/dfa-infloop
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This would infloop for some unreleased versions between 2.26 and 2.27
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+require_timeout_
+
+fail=0
+
+echo cx > in || framework_failure_
+returns_ 1 timeout 10 env LC_ALL=C grep -E 'c\b[x ]' in || fail=1
+
+Exit $fail