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

Re: [PATCH] send-pack: clean up extra_have oid array

From
Jeff King <peff@peff.net>
Date
Jul 3, 2025, 15:38 UTC
Message-ID
<20250703153853.GC1309870@coredump.intra.peff.net>
In-Reply-To
<20250627-jk-fix-leak-send-pack-v1-1-aadcf0ed8a4b@gmail.com>
On Fri, Jun 27, 2025 at 03:09:04PM -0700, Jacob Keller wrote:
Show 8 quoted lines
> From: Jacob Keller <jacob.keller@gmail.com>
> 
> Commit c8009635785e ("fetch-pack, send-pack: clean up shallow oid
> array", 2024-09-25) cleaned up the shallow oid array in cmd_send_pack,
> but didn't clean up extra_have, which is still leaked at program exit.
> I suspect the particular tests in t5539 don't trigger any additions to
> the extra_have array, which explains why the tests can pass leak free
> despite this gap.

Thanks, this looks good. At the time I did that other commit, I was focused on just bug-hunting the leaks reported by the tests. So I missed this one.

> I didn't check to see why the t5539 tests don't leak. This leak occured for
> me in a day-to-day run with my local git build that happened to still have
> sanitizers enabled:

The tests are leak-free now, but I suspect we have a lot of slightly-exotic command invocations like this that still leak. It might be nice to beef up the test coverage, but I'm OK with just fixing them, too.

-Peff
Previous: Jacob Keller
Message 9 of 9 in “send-pack: clean up extra_have oid array”
  1. send-pack: clean up extra_have oid arrayJacob Keller, Jun 27, 2025
  2. Junio C HamanoJun 30, 2025
  3. Jacob KellerJun 30, 2025
  4. Junio C HamanoJul 1, 2025
  5. Jacob KellerJul 1, 2025
  6. Junio C HamanoJul 1, 2025
  7. Jeff KingJul 3, 2025
  8. Jacob KellerJul 3, 2025
  9. Jeff KingJul 3, 2025

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.