Re: [PATCH 2/2] grep: fix segfault under -P + PCRE2 + (*NO_JIT)
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 22, 2017, 18:18 UTC
- Message-ID
- <CAPig+cS_R5wcJQNavGSgNQXtbXNbDsTDhj8cbSZ5BBxRqU8yRQ@mail.gmail.com>
- In-Reply-To
- <20171122133630.18931-2-avarab@gmail.com>
On Wed, Nov 22, 2017 at 8:36 AM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 9 quoted lines
> Fix a bug in the compilation of PCRE2 patterns under JIT (the most
> common runtime configuration), any pattern with a (*NO_JIT) verb would
> segfault. This bug dates back to my 94da9193a6 ("grep: add support for
> PCRE v2", 2017-06-01):
>
> $ git grep -P '(*NO_JIT)hi.*there'
> Segmentation fault
>
> As explained ad more length in the comment being added here it isn'ts/ad/at/ s/here/here,/
Show 10 quoted lines
> sufficient to just check pcre2_config() to see whether the JIT should > be used, pcre2_pattern_info() also has to be asked. > > This is something I discovered myself when fiddling around with PCRE2 > verbs in patterns passed to git. I don't expect that any user of git > has encountered this given the obscurity of passing PCRE2 verbs > through to the library, along with the relative obscurity of (*NO_JIT) > itself. > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>