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

Re: [PATCH] builtin/history: unuse the commit buffer after use

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Jun 30, 2026, 03:43 UTC
Message-ID
<94b0bed5-c86a-4291-b958-52f09faebd29@gmail.com>
In-Reply-To
<ai_KWo9o1Fhc6OFs@pks.im>
Hi Patrick,
On 15/06/26 15:18, Patrick Steinhardt wrote:
> Huh, curious. That seems to hint that we're missing test coverage for
> this specific scenario, as our test suite doesn't detect this leak.
>

Indeed. The tricky thing is (as mentioned in another thread), this is happening only when we get a commit not cached in the commit slab. Once we get an idea on how certain commits get cached in the commit slab while others don't, we can write a test case that would catch this leak.

> 
> So this doesn't really read specific at all, and I would have expected
> us to hit this leak. Puzzling.
>

Yeah. My bad with the commit message. The leak is not happening always. That is a reason we may not have caught this in the test suite.

Show 13 quoted lines
>> I must mention that I also noticed the following comment in `commit_tree_ext`:
>>
>> »       /* We retain authorship of the original commit. */
>> »       original_message = repo_logmsg_reencode(repo, commit_with_message, NULL, NULL);
>>
>> ... but I'm not quite sure why we don't unuse the buffer after its purpose is
>> done. Kindly englighten me in case I missed something.
> 
> Did you maybe confuse "authorship" with "ownership" while reading the
> comment? The comment only mentions that we retain the original "Author"
> commit metadata, it doesn't refer to ownership of the underlying
> objects.
>
Got it. Thank you for the correction!

-- Sivaraam

PS: Sorry about the delay in response. Was stuck with some personal work.
Previous: Jeff KingNext: Jeff King
Message 7 of 17 in “builtin/history: unuse the commit buffer after use”
  1. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Jun 14, 2026
  2. Patrick SteinhardtJun 15, 2026
  3. Jeff KingJun 15, 2026
  4. Patrick SteinhardtJun 16, 2026
  5. Kaartic SivaraamJun 30, 2026
  6. Jeff KingJun 30, 2026
  7. Kaartic SivaraamJun 30, 2026
  8. Jeff KingJun 30, 2026
  9. Jeff KingJun 30, 2026
  10. Jeff KingJun 30, 2026
  11. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 10, 2026
  12. Junio C HamanoSep 10, 2026
  13. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 10, 2026
  14. Jeff KingSep 10, 2026
  15. Junio C HamanoSep 10, 2026
  16. Kaartic SivaraamSep 10, 2026
  17. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 15, 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.