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

Re: [PATCH 1/3] bloom: make bloom-filter slab initialization idempotent

From
Derrick Stolee <stolee@gmail.com>
Date
Jul 1, 2026, 13:53 UTC
Message-ID
<f7384ae3-bcd3-4191-9ff9-1ab86701c762@gmail.com>
In-Reply-To
<20260701063942.GA2580331@coredump.intra.peff.net>
On 7/1/2026 2:39 AM, Jeff King wrote:
Show 5 quoted lines
> Before using any of the commit-graph bloom-filter code, somebody needs
> to call init_bloom_filters(). This initializes the commit-slab we use
> for storing filter information. But we don't want to call it twice
> (without a matching deinit call in the middle), since it overwrites the
> existing slab pointers, leaking the old values.
...
> This patch takes a smaller and more direct route to just dealing with
> the potential leak issue.
> +static int bloom_filter_slab_initialized;
Show 7 quoted lines
>  void init_bloom_filters(void)
>  {
> +	if (bloom_filter_slab_initialized)
> +		return;
>  	init_bloom_filter_slab(&bloom_filters);
> +	bloom_filter_slab_initialized = 1;
>  }
>  {
>  	deep_clear_bloom_filter_slab(&bloom_filters, free_one_bloom_filter);
> +	bloom_filter_slab_initialized = 0;
>  }
This patch looks like the right fix.

Thanks, -Stolee

Previous: Jeff KingNext: Junio C Hamano
Message 3 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.