mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <>
To: Eric Sunshine <>
Cc: Git List <>, Junio C Hamano <>
Subject: Re: [PATCH 2/2] grep: fix segfault under -P + PCRE2 + (*NO_JIT)
Date: Thu, 23 Nov 2017 10:15:44 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Nov 22 2017, Eric Sunshine jotted:

> On Wed, Nov 22, 2017 at 8:36 AM, Ævar Arnfjörð Bjarmason
> <> wrote:
>> 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't
> s/ad/at/
> s/here/here,/

Thanks. I'll let this sit for a bit and submit a v2 soon. There's also
an upstream fix in pcre2 to prevent the segfault that'll be in future
versions & I'm going to note in the amended commit message.

>> 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 <>

  reply	other threads:[~2017-11-23  9:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 13:36 [PATCH 1/2] test-lib: add LIBPCRE1 & LIBPCRE2 prerequisites Ævar Arnfjörð Bjarmason
2017-11-22 13:36 ` [PATCH 2/2] grep: fix segfault under -P + PCRE2 + (*NO_JIT) Ævar Arnfjörð Bjarmason
2017-11-22 18:18   ` Eric Sunshine
2017-11-23  9:15     ` Ævar Arnfjörð Bjarmason [this message]
2017-11-23  9:10   ` Simon Ruderich
2017-11-23 14:16   ` [PATCH v2 1/2] test-lib: add LIBPCRE1 & LIBPCRE2 prerequisites Ævar Arnfjörð Bjarmason
2017-11-23 14:16   ` [PATCH v2 2/2] grep: fix segfault under -P + PCRE2 <=10.30 + (*NO_JIT) Ævar Arnfjörð Bjarmason
2017-11-22 20:22 ` [PATCH 1/2] test-lib: add LIBPCRE1 & LIBPCRE2 prerequisites Jonathan Nieder
2017-11-23  9:11   ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).