Subject: [PATCH 0/1] Fix a problem with PCRE2 and nedmalloc, found via Azure Pipelines

From: "Johannes Schindelin via GitGitGadget" <[email-masked]>
Date: Mon, 05 Aug 2019 04:51:08 -0700 (PDT)

For a couple of days, maybe even a week, pu fails consistently, in the
Windows job where it tests t7816. The symptom is a segmentation fault.

I finally got to diagnose this, and it looked at first as if there was yet
another buffer overrun that was so small that valgrind failed to detect it
(see https://github.com/gitgitgadget/git/pull/178). The problem is another
one, though: we ask PCRE2 to allocate a table (and it uses the system
allocator for that), and then try to release it using nedmalloc's free() 
replacement.

This is squarely a problem with cb/pcre2-chartables-leakfix in conjunction
with an overridden allocator.

Junio, for your convenience, I rebased this patch directly on top of 
ab/pcre-v2 and pushed out the let-pcre2-respect-nedmalloc branch at 
https://github.com/dscho/git ready to be pulled. The rebased version is not
technically a bug fix, as I do not see any way that ab/pcre-v2 uses
mismatched allocators for malloc()/free(), but just in case that you wanted
to have it in v2.23.0 and not on top cb/pcre2-chartables-leakfix...

Johannes Schindelin (1):
  pcre2: allow overriding the system allocator

 grep.c | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

base-commit: 7d3bf76999452ff64c84cec25fd95a7a95744b78
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-306%2Fdscho%2Ffix-for-pcre-chartables-leakfix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-306/dscho/fix-for-pcre-chartables-leakfix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/306
-- 
gitgitgadget