{"thread":{"id":"57599","subject":"improve performance of PCRE2 bug 2642 bug workaround","startedAt":"2022-03-22T16:48:25Z","lastAt":"2022-03-23T20:24:50Z","messageCount":7,"participants":["Paul Eggert","René Scharfe","Carlo Marcelo Arenas Belón","Carlo Arenas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"451851","messageId":"bd751d5c-2f8b-4c52-72ec-f2b7268a30a8@cs.ucla.edu","threadId":"57599","inReplyTo":null,"subject":"improve performance of PCRE2 bug 2642 bug workaround","fromName":"Paul Eggert","fromEmail":"eggert@cs.ucla.edu","sentAt":"2022-03-22T16:38:42Z","receivedAt":"2022-03-22T16:48:25Z","isPatch":false,"sender":{"key":"eggert@cs.ucla.edu","avatar":"https://avatars.githubusercontent.com/u/572024?v=4"},"body":"Today, Carlo Arenas pointed out[1] that GNU grep didn't work around \nPCRE2 bug 2642, which Git grep has a workaround for. While installing a \nGNU grep patch to fix this[2] I noticed that Git's workaround appears to \nbe too pessimistic: on older PCRE2 libraries Git grep sets \nPCRE2_NO_START_OPTIMIZE even when PCRE2_CASELESS is not set.\n\nAttached is a patch to Git that I just now cobbled up and have not even \ncompiled, much less tested. Please feel free to ignore it, as it would \nmerely improve performance on older, buggy PCRE2 libraries and that \nmight not be worth your trouble. I'm sending this email as more of a \nthank-you for letting us know indirectly of the PCRE2 bug.\n\n[1]: https://lists.gnu.org/r/grep-devel/2022-03/msg00004.html\n[2]: https://lists.gnu.org/r/grep-devel/2022-03/msg00005.html\n\ndiff --git a/grep.c b/grep.c\nindex 82eb7da102..b9553ec9f5 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -297,7 +297,9 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt\n \n #ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER\n \t/* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */\n-\tif (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS))\n+\tif (PCRE2_MATCH_INVALID_UTF &&\n+\t    ((options & (PCRE2_UTF | PCRE2_CASELESS)) ==\n+\t     (PCRE2_UTF | PCRE2_CASELESS)))\n \t\toptions |= PCRE2_NO_START_OPTIMIZE;\n #endif\n \n"},{"id":"451927","messageId":"99b0adb6-26ba-293c-3a8f-679f59e7cb4d@web.de","threadId":"57599","inReplyTo":"bd751d5c-2f8b-4c52-72ec-f2b7268a30a8@cs.ucla.edu","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2022-03-22T20:26:10Z","receivedAt":"2022-03-22T20:26:30Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 22.03.22 um 17:38 schrieb Paul Eggert:\n> Today, Carlo Arenas pointed out[1] that GNU grep didn't work around\n> PCRE2 bug 2642, which Git grep has a workaround for. While installing\n> a GNU grep patch to fix this[2] I noticed that Git's workaround\n> appears to be too pessimistic: on older PCRE2 libraries Git grep sets\n> PCRE2_NO_START_OPTIMIZE even when PCRE2_CASELESS is not set.\n>\n> Attached is a patch to Git that I just now cobbled up and have not\n> even compiled, much less tested. Please feel free to ignore it, as it\n> would merely improve performance on older, buggy PCRE2 libraries and\n> that might not be worth your trouble. I'm sending this email as more\n> of a thank-you for letting us know indirectly of the PCRE2 bug.\n>\n> [1]: https://lists.gnu.org/r/grep-devel/2022-03/msg00004.html\n> [2]: https://lists.gnu.org/r/grep-devel/2022-03/msg00005.html\n\nInteresting.  So you say bug 2642 [3] requires the flag PCRE2_CASELESS\n(i.e. --ignore-case) to be triggered.  (That's probably documented in\nBugzilla, but I'm not authorized to access it.)\n\nHowever, the looser check works around another bug, if only by accident.\nI believe it was fixed upstream by [4].  That other bug was discussed in\nthe thread Carlo linked to, which started at [5].  You should be able to\nreproduce it with something like this (search for leading white-space in\na Unicode haystack):\n\n  $ echo ' Halló' | grep -P '^\\s'\n\nAn affected version of PCRE2 would loop forever.\n\nHowever, I can only test any of that with CI jobs, not locally, so\nplease take my findings with a heap of salt.\n\nRené\n\n\n[3] https://bugs.exim.org/show_bug.cgi?id=2642\n[4] https://github.com/PhilipHazel/pcre2/commit/e0c6029\n[5] https://lore.kernel.org/git/20220129172542.GB2581@szeder.dev/\n"},{"id":"451929","messageId":"325b7ba6-04a8-0010-a288-a118a820f3c3@cs.ucla.edu","threadId":"57599","inReplyTo":"99b0adb6-26ba-293c-3a8f-679f59e7cb4d@web.de","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"Paul Eggert","fromEmail":"eggert@cs.ucla.edu","sentAt":"2022-03-22T21:12:43Z","receivedAt":"2022-03-22T21:12:50Z","isPatch":false,"sender":{"key":"eggert@cs.ucla.edu","avatar":"https://avatars.githubusercontent.com/u/572024?v=4"},"body":"On 3/22/22 13:26, René Scharfe wrote:\n\n> However, the looser check works around another bug, if only by accident.\n\nThanks for letting me know. In that case, GNU grep should use a looser \ncheck too, like Git grep does. I installed the attached into GNU grep.\n\nFrom ff2d24b08223e6c7b704a91127bac4391a9b8adb Mon Sep 17 00:00:00 2001\nFrom: Paul Eggert <eggert@cs.ucla.edu>\nDate: Tue, 22 Mar 2022 14:09:05 -0700\nSubject: [PATCH] grep: work around another potential PCRE2 bug\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nPotential problem reported by René Scharfe in:\nhttps://lore.kernel.org/git/99b0adb6-26ba-293c-3a8f-679f59e7cb4d@web.de/T\n* src/pcresearch.c (Pcompile): Mimic git grep’s workarounds\nfor PCRE2 bugs more closely; this is more conservative.\n---\n src/pcresearch.c | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/src/pcresearch.c b/src/pcresearch.c\nindex 0cf804d..6947838 100644\n--- a/src/pcresearch.c\n+++ b/src/pcresearch.c\n@@ -154,15 +154,16 @@ Pcompile (char *pattern, idx_t size, reg_syntax_t ignored, bool exact)\n #ifdef PCRE2_MATCH_INVALID_UTF\n       /* Consider invalid UTF-8 as a barrier, instead of error.  */\n       flags |= PCRE2_MATCH_INVALID_UTF;\n-\n-# if ! (10 < PCRE2_MAJOR + (36 <= PCRE2_MINOR))\n-      /* Work around PCRE2 bug 2642.  */\n-      if (flags & PCRE2_CASELESS)\n-        flags |= PCRE2_NO_START_OPTIMIZE;\n-# endif\n #endif\n     }\n \n+#if defined PCRE2_MATCH_INVALID_UTF && !(10 < PCRE2_MAJOR + (36 <= PCRE2_MINOR))\n+  /* Work around PCRE2 bug 2642, and another bug reportedly fixed in\n+     PCRE2 commit e0c6029a62db9c2161941ecdf459205382d4d379.  */\n+  if (flags & (PCRE2_UTF | PCRE2_CASELESS))\n+    flags |= PCRE2_NO_START_OPTIMIZE;\n+#endif\n+\n   /* FIXME: Remove this restriction.  */\n   if (rawmemchr (pattern, '\\n') != patlim)\n     die (EXIT_TROUBLE, 0, _(\"the -P option only supports a single pattern\"));\n-- \n2.32.0\n\n"},{"id":"451937","messageId":"20220323010931.jzf7op7hdusdty33@carlos-mbp.lan","threadId":"57599","inReplyTo":"99b0adb6-26ba-293c-3a8f-679f59e7cb4d@web.de","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2022-03-23T01:09:31Z","receivedAt":"2022-03-23T01:09:37Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Tue, Mar 22, 2022 at 09:26:10PM +0100, René Scharfe wrote:\n> Am 22.03.22 um 17:38 schrieb Paul Eggert:\n> > Today, Carlo Arenas pointed out[1] that GNU grep didn't work around\n> > PCRE2 bug 2642, which Git grep has a workaround for. While installing\n> > a GNU grep patch to fix this[2] I noticed that Git's workaround\n> > appears to be too pessimistic: on older PCRE2 libraries Git grep sets\n> > PCRE2_NO_START_OPTIMIZE even when PCRE2_CASELESS is not set.\n> \n> Interesting.  So you say bug 2642 [3] requires the flag PCRE2_CASELESS\n> (i.e. --ignore-case) to be triggered.  (That's probably documented in\n> Bugzilla, but I'm not authorized to access it.)\n\nAFAIK the contents of the bugzilla are no longer accessible to anyone (lost in the migration of PCRE2 to github), but the use of PCRE2_CASELESS introduced in 95ca1f987e (grep/pcre2: better support invalid UTF-8 haystacks, 2021-01-24) might had been a mistake all along.\n\nthe bug will trigger when both PCRE2_UTF and PCRE2_MULTILINE are set (as shown in the PCRE2 regression added), with the later set by default in git and NEVER set in GNU grep, hence why I later retracted[6] my suggestion to add the workaround to grep, and suggest updating git with the following\n\nCarlo\n\n[6] https://lists.gnu.org/r/grep-devel/2022-03/msg00006.html\n--- >8 ---\nSubject: [PATCH] grep: remove check for case sensitivity in workaround for\n PCRE's bug2642\n\n95ca1f987e (grep/pcre2: better support invalid UTF-8 haystacks, 2021-01-24)\nadd a workaround to an old PCRE2 bug, but includes in the logic a partial\ncheck for case sensitivity without explanation.\n\nRemove it so that the workaround (and its performance impact) will be only\ntriggered when needed (both PCRE2_MULTILINE and PCRE2_UTF and JIT is used)\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n grep.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/grep.c b/grep.c\nindex 82eb7da102..d910836569 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -296,8 +296,8 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt\n \t\toptions |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF);\n \n #ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER\n-\t/* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */\n-\tif (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS))\n+\t/* Work around PCRE2 bug2642 fixed in 10.36 */\n+\tif (SUPPORT_JIT && PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF))\n \t\toptions |= PCRE2_NO_START_OPTIMIZE;\n #endif\n \n-- \n2.35.1.505.g27486cd1b2d\n\n"},{"id":"451947","messageId":"3642dffd-2241-9fd4-3ab8-04ce14c0f1a8@cs.ucla.edu","threadId":"57599","inReplyTo":"20220323010931.jzf7op7hdusdty33@carlos-mbp.lan","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"Paul Eggert","fromEmail":"eggert@cs.ucla.edu","sentAt":"2022-03-23T04:06:39Z","receivedAt":"2022-03-23T04:06:44Z","isPatch":false,"sender":{"key":"eggert@cs.ucla.edu","avatar":"https://avatars.githubusercontent.com/u/572024?v=4"},"body":"On 3/22/22 18:09, Carlo Marcelo Arenas Belón wrote:\n\n> AFAIK the contents of the bugzilla are no longer accessible to anyone (lost in the migration of PCRE2 to github),\n\nYes, that confused me too.\n\n> the bug will trigger when both PCRE2_UTF and PCRE2_MULTILINE are set (as shown in the PCRE2 regression added), with the later set by default in git and NEVER set in GNU grep, hence why I later retracted[6] my suggestion to add the workaround to grep\n\nOK, thanks, I installed the attached to GNU grep and we'll call it a day.\n\nFrom 743b1f6f5ca7ee86348fa0593da2eff03df1a82a Mon Sep 17 00:00:00 2001\nFrom: Paul Eggert <eggert@cs.ucla.edu>\nDate: Tue, 22 Mar 2022 20:12:38 -0700\nSubject: [PATCH] grep: Remove recent PCRE2 bug workarounds\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n* src/pcresearch.c (Pcompile): Remove recent workaround for PCRE2\nbugs; apparently it’s not needed.  This reverts back to where\nthings were before today.  Suggested by Carlo Arenas in:\nhttps://lists.gnu.org/r/grep-devel/2022-03/msg00006.html\n---\n src/pcresearch.c | 7 -------\n 1 file changed, 7 deletions(-)\n\ndiff --git a/src/pcresearch.c b/src/pcresearch.c\nindex 6947838..f332a44 100644\n--- a/src/pcresearch.c\n+++ b/src/pcresearch.c\n@@ -157,13 +157,6 @@ Pcompile (char *pattern, idx_t size, reg_syntax_t ignored, bool exact)\n #endif\n     }\n \n-#if defined PCRE2_MATCH_INVALID_UTF && !(10 < PCRE2_MAJOR + (36 <= PCRE2_MINOR))\n-  /* Work around PCRE2 bug 2642, and another bug reportedly fixed in\n-     PCRE2 commit e0c6029a62db9c2161941ecdf459205382d4d379.  */\n-  if (flags & (PCRE2_UTF | PCRE2_CASELESS))\n-    flags |= PCRE2_NO_START_OPTIMIZE;\n-#endif\n-\n   /* FIXME: Remove this restriction.  */\n   if (rawmemchr (pattern, '\\n') != patlim)\n     die (EXIT_TROUBLE, 0, _(\"the -P option only supports a single pattern\"));\n-- \n2.32.0\n\n"},{"id":"452016","messageId":"1187feda-c14a-f75c-6e09-4df101f00056@web.de","threadId":"57599","inReplyTo":"20220323010931.jzf7op7hdusdty33@carlos-mbp.lan","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2022-03-23T18:37:22Z","receivedAt":"2022-03-23T18:42:46Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 23.03.22 um 02:09 schrieb Carlo Marcelo Arenas Belón:\n> On Tue, Mar 22, 2022 at 09:26:10PM +0100, René Scharfe wrote:\n>> Am 22.03.22 um 17:38 schrieb Paul Eggert:\n>>> Today, Carlo Arenas pointed out[1] that GNU grep didn't work around\n>>> PCRE2 bug 2642, which Git grep has a workaround for. While installing\n>>> a GNU grep patch to fix this[2] I noticed that Git's workaround\n>>> appears to be too pessimistic: on older PCRE2 libraries Git grep sets\n>>> PCRE2_NO_START_OPTIMIZE even when PCRE2_CASELESS is not set.\n>>\n>> Interesting.  So you say bug 2642 [3] requires the flag PCRE2_CASELESS\n>> (i.e. --ignore-case) to be triggered.  (That's probably documented in\n>> Bugzilla, but I'm not authorized to access it.)\n>\n> AFAIK the contents of the bugzilla are no longer accessible to anyone\n> (lost in the migration of PCRE2 to github), but the use of\n> PCRE2_CASELESS introduced in 95ca1f987e (grep/pcre2: better support\n> invalid UTF-8 haystacks, 2021-01-24) might had been a mistake all\n> along.\n\nAh, OK.\n\n> the bug will trigger when both PCRE2_UTF and PCRE2_MULTILINE are set\n> (as shown in the PCRE2 regression added), with the later set by\n> default in git and NEVER set in GNU grep, hence why I later\n> retracted[6] my suggestion to add the workaround to grep, and suggest\n> updating git with the following\n> Carlo\n>\n> [6] https://lists.gnu.org/r/grep-devel/2022-03/msg00006.html\n> --- >8 ---\n> Subject: [PATCH] grep: remove check for case sensitivity in workaround for\n>  PCRE's bug2642\n>\n> 95ca1f987e (grep/pcre2: better support invalid UTF-8 haystacks, 2021-01-24)\n> add a workaround to an old PCRE2 bug, but includes in the logic a partial\n> check for case sensitivity without explanation.\n>\n> Remove it so that the workaround (and its performance impact) will be only\n> triggered when needed (both PCRE2_MULTILINE and PCRE2_UTF and JIT is used)\n>\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> ---\n>  grep.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/grep.c b/grep.c\n> index 82eb7da102..d910836569 100644\n> --- a/grep.c\n> +++ b/grep.c\n> @@ -296,8 +296,8 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt\n>  \t\toptions |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF);\n>\n>  #ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER\n> -\t/* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */\n> -\tif (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS))\n> +\t/* Work around PCRE2 bug2642 fixed in 10.36 */\n> +\tif (SUPPORT_JIT && PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF))\n\nSUPPORT_JIT can be undefined and then this won't compile.\n\nAnd if I turn it into an \"#ifdef SUPPORT_JIT\", t7812.16 fails with PCRE2\nversions 10.34 and 10.35.\n\nSUPPORT_JIT is defined in PCRE2's config.h and not baked into any of its\npublic headers, so it never will be set in grep.c, right?  Perhaps just\ndrop this condition?\n\nThe patch below adds a test that fails even with a PCRE2 configured with\n--disable-git.  Current main passes this test even with PCRE2 versions\n10.34 and 10.35.\n\n\"PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF)\" can be simplified to\n\"options & PCRE2_MATCH_INVALID_UTF\".\n\n>  \t\toptions |= PCRE2_NO_START_OPTIMIZE;\n>  #endif\n>\n\n--- >8 ---\nSubject: [PATCH] t7812: test PCRE2 whitespace bug\n\nCheck 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---\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"},{"id":"452027","messageId":"CAPUEspjXy2dLF0B3c6aQ3tfUFV3q2SDdULnY7u4otGicicYk1Q@mail.gmail.com","threadId":"57599","inReplyTo":"1187feda-c14a-f75c-6e09-4df101f00056@web.de","subject":"Re: improve performance of PCRE2 bug 2642 bug workaround","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2022-03-23T20:24:33Z","receivedAt":"2022-03-23T20:24:50Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Wed, Mar 23, 2022 at 11:37 AM René Scharfe <l.s.r@web.de> wrote:\n>\n> Am 23.03.22 um 02:09 schrieb Carlo Marcelo Arenas Belón:\n> > On Tue, Mar 22, 2022 at 09:26:10PM +0100, René Scharfe wrote:\n> >> Interesting.  So you say bug 2642 [3] requires the flag PCRE2_CASELESS\n> >> (i.e. --ignore-case) to be triggered.  (That's probably documented in\n> >> Bugzilla, but I'm not authorized to access it.)\n> >\n> > AFAIK the contents of the bugzilla are no longer accessible to anyone\n> > (lost in the migration of PCRE2 to github), but the use of\n> > PCRE2_CASELESS introduced in 95ca1f987e (grep/pcre2: better support\n> > invalid UTF-8 haystacks, 2021-01-24) might have been a mistake all\n> > along.\n>\n> Ah, OK.\n\nIt happens though that the original bug2642 did require PCRE2_CASELESS\nand was fixed instead by PhilipHazel/pcre2@f8cbb1f5[7], so you were correct\nwhen suggesting that the lazy coding of the condition was fixing more than one\nbug and therefore it will be better left unchanged IMHO (except maybe from\nan improved comment)\n\n> The patch below adds a test that fails even with a PCRE2 configured with\n> --disable-git.  Current main passes this test even with PCRE2 versions\n> 10.34 and 10.35.\n>\n> \"PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF)\" can be simplified to\n> \"options & PCRE2_MATCH_INVALID_UTF\".\n\nindeed, but will also need the PCRE2_CASELESS part that was required\nfrom the original bug\n\nthanks for adding a test for the infinite loop one, will definitely\nhelp future readers.\n\nCarlo\n"}]}