git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: improve performance of PCRE2 bug 2642 bug workaround

From
Carlo Arenas <carenas@gmail.com>
Date
Mar 23, 2022, 20:24 UTC
Message-ID
<CAPUEspjXy2dLF0B3c6aQ3tfUFV3q2SDdULnY7u4otGicicYk1Q@mail.gmail.com>
In-Reply-To
<1187feda-c14a-f75c-6e09-4df101f00056@web.de>
On Wed, Mar 23, 2022 at 11:37 AM René Scharfe <l.s.r@web.de> wrote:
Show 14 quoted lines
>
> Am 23.03.22 um 02:09 schrieb Carlo Marcelo Arenas Belón:
> > On Tue, Mar 22, 2022 at 09:26:10PM +0100, René Scharfe wrote:
> >> Interesting.  So you say bug 2642 [3] requires the flag PCRE2_CASELESS
> >> (i.e. --ignore-case) to be triggered.  (That's probably documented in
> >> Bugzilla, but I'm not authorized to access it.)
> >
> > AFAIK 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 have been a mistake all
> > along.
>
> Ah, OK.

It happens though that the original bug2642 did require PCRE2_CASELESS and was fixed instead by PhilipHazel/pcre2@f8cbb1f5[7], so you were correct when suggesting that the lazy coding of the condition was fixing more than one bug and therefore it will be better left unchanged IMHO (except maybe from an improved comment)

Show 6 quoted lines
> The patch below adds a test that fails even with a PCRE2 configured with
> --disable-git.  Current main passes this test even with PCRE2 versions
> 10.34 and 10.35.
>
> "PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF)" can be simplified to
> "options & PCRE2_MATCH_INVALID_UTF".

indeed, but will also need the PCRE2_CASELESS part that was required from the original bug

thanks for adding a test for the infinite loop one, will definitely help future readers.

Carlo
Previous: René Scharfe
Message 7 of 7 in “improve performance of PCRE2 bug 2642 bug workaround”
  1. Paul EggertMar 22, 2022
  2. René ScharfeMar 22, 2022
  3. Paul EggertMar 22, 2022
  4. Carlo Marcelo Arenas BelónMar 23, 2022
  5. Paul EggertMar 23, 2022
  6. René ScharfeMar 23, 2022
  7. Carlo ArenasMar 23, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.