Skip to content

plugging some mmap() leaks

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4check_connected(): delay opening new_packconnected.c+15 -181 reply
2/4check_connected(): fix leak of pack-index mmapconnected.c+4 -11 reply
3/4pack-revindex: avoid double-loading .rev filespack-revindex.c+4 -00 replies
4/4Makefile: turn on NO_MMAP when building with LSanMakefile+1 -07 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchJacob Keller
1/4R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] plugging some mmap() leaks
Quoted 2 lines · Jeff King

Anyway, I think the solution is probably something like the patch above, though probably it needs to cover the case where new_pack is NULL.

So here is a more polished version. I decided to try running the whole test suite with leak-checking and NO_MMAP, and it turned up one other case. This series fixes that, too, and then turns on the flag for all leak-checking builds.

[1/4]: check_connected(): delay opening new_pack [2/4]: check_connected(): fix leak of pack-index mmap [3/4]: pack-revindex: avoid double-loading .rev files [4/4]: Makefile: turn on NO_MMAP when building with LSan

 Makefile        |  1 +
 connected.c     | 38 +++++++++++++++++++-------------------
 pack-revindex.c |  4 ++++
 3 files changed, 24 insertions(+), 19 deletions(-)

-Peff