Fix a problem with PCRE2 and nedmalloc, found via Azure Pipelines #306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #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 thelet-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 thatab/pcre-v2
uses mismatched allocators formalloc()
/free()
, but just in case that you wanted to have it in v2.23.0 and not on topcb/pcre2-chartables-leakfix
...Cc: Carlo Marcelo Arenas Belón [email protected]