{"thread":{"id":"57697","subject":"[PATCH RESEND] t7812: test PCRE2 whitespace bug","startedAt":"2022-04-08T16:22:11Z","lastAt":"2022-04-08T16:22:11Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"453339","messageId":"3a49649d-8ff9-e5a7-e3fd-33fee5068ae8@web.de","threadId":"57697","inReplyTo":null,"subject":"[PATCH RESEND] t7812: test PCRE2 whitespace bug","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2022-04-08T16:21:52Z","receivedAt":"2022-04-08T16:22:11Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Check if git grep works around the PCRE2 big fixed by their e0c6029\n(Fix inifinite loop when a single byte newline is searched in JIT.,\n2020-05-29), which affects version 10.35 and earlier.\n\nSearching for leading whitespace also triggers the endless loop.\nSet a one-second alarm to abort in case we do get hit by the bug, to\navoid having to wait forever for the test result.\n\nReported-by: SZEDER Gábor <szeder.dev@gmail.com>\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nOriginal submission:\nhttps://lore.kernel.org/git/1187feda-c14a-f75c-6e09-4df101f00056@web.de/\n\n t/t7812-grep-icase-non-ascii.sh | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh\nindex 9047d665a1..ac7be54714 100755\n--- a/t/t7812-grep-icase-non-ascii.sh\n+++ b/t/t7812-grep-icase-non-ascii.sh\n@@ -4,6 +4,10 @@ test_description='grep icase on non-English locales'\n\n . ./lib-gettext.sh\n\n+doalarm () {\n+\tperl -e 'alarm shift; exec @ARGV' -- \"$@\"\n+}\n+\n test_expect_success GETTEXT_LOCALE 'setup' '\n \ttest_write_lines \"TILRAUN: Halló Heimur!\" >file &&\n \tgit add file &&\n@@ -139,4 +143,10 @@ test_expect_success GETTEXT_LOCALE,LIBPCRE2 'PCRE v2: grep non-literal ASCII fro\n \ttest_cmp expected actual\n '\n\n+test_expect_success GETTEXT_LOCALE,LIBPCRE2 'PCRE v2: grep avoid endless loop bug' '\n+\techo \" Halló\" >leading-whitespace &&\n+\tgit add leading-whitespace &&\n+\tdoalarm 1 git grep --perl-regexp \"^\\s\" leading-whitespace\n+'\n+\n test_done\n--\n2.35.1\n"}]}