git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] revision: avoid leaking bloom keyvecs with multiple traversals

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 1, 2026, 15:52 UTC
Message-ID
<xmqqmrwapuzz.fsf@gitster.g>
In-Reply-To
<20260701064052.GB2580331@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> I think it would _probably_ work in practice, since any caller using a
> rev_info for multiple traversals is probably doing so with the same
> pathspec. But it would also create a very subtle bug if that assumption
> is violated. So we'll do the safer thing here, and generate fresh keyvec
> entries for each traversal. The efficiency difference is probably not
> noticeable, and this is what was happening already (we just weren't
> bothering to free the old ones!).

Good to see the thinking behind the design recorded so clearly in the log message. That thinking being on the more conservative side is a big plus.

Show 17 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  revision.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/revision.c b/revision.c
> index e91d7e1f11..0ef9d895f0 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -707,6 +707,8 @@ static int convert_pathspec_to_bloom_keyvec(struct bloom_keyvec **out,
>  
>  static void prepare_to_use_bloom_filter(struct rev_info *revs)
>  {
> +	release_revisions_bloom_keyvecs(revs);
> +
>  	if (!revs->commits)
>  		return;
Previous: Derrick StoleeNext: Jeff King
Message 8 of 11 in “bloom-related leak fixes”
  1. 0/3 bloom-related leak fixesJeff King, Jul 1, 2026
  2. 1/3 bloom: make bloom-filter slab initialization idempotentJeff King, Jul 1, 2026
  3. Derrick StoleeJul 1, 2026
  4. Junio C HamanoJul 1, 2026
  5. 2/3 revision: avoid leaking bloom keyvecs with multiple traversalsJeff King, Jul 1, 2026
  6. Patrick SteinhardtJul 1, 2026
  7. Derrick StoleeJul 1, 2026
  8. Junio C HamanoJul 1, 2026
  9. 3/3 line-log: drop extra copy of range with bloom filtersJeff King, Jul 1, 2026
  10. Derrick StoleeJul 1, 2026
  11. Junio C HamanoJul 1, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.