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

Re: [PATCH 3/3] odb: properly close sources before freeing them

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 6, 2025, 11:38 UTC
Message-ID
<aTQVt4zgMbsX_6tD@pks.im>
In-Reply-To
<CAPig+cRW6tXFTqqnhH1Be33TgzT2dsdzNLFii3Now7+DNiTTvw@mail.gmail.com>
On Fri, Dec 05, 2025 at 06:14:22PM -0500, Eric Sunshine wrote:
Show 10 quoted lines
> On Fri, Dec 5, 2025 at 6:36 AM Patrick Steinhardt <ps@pks.im> wrote:
> > In the next commit we are about to move the packfile store into the ODB
> > source so that we have one store per source. This will lead to a memory
> > leak in the following commit when reading data from a submodule via
> > git-grep(1):
> > [...]
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> 
> Considering that this is patch [3/3], to what does "In the next
> commit..." refer?

Good catch! I split this out of another, bigger, patch series. But as I've started to hit the leak in a different patch series, as well, I decided to split it out into a smaller patch series.

I've queued the following change locally, but will refrain from sending out a new version for now.

Thanks!
Patrick
1:  5c15065406 = 1:  9f813d92f3 builtin/repack: fix geometric repacks with promisor remotes
2:  2fa3991003 = 2:  02167bfb16 builtin/gc: fix condition for whether to write commit graphs
3:  a06d0716c3 ! 3:  c9ca233c29 odb: properly close sources before freeing them
    @@ Commit message
         odb: properly close sources before freeing them
     
         In the next commit we are about to move the packfile store into the ODB
    -    source so that we have one store per source. This will lead to a memory
    -    leak in the following commit when reading data from a submodule via
    -    git-grep(1):
    +    source so that we have one store per source. This can lead to a memory
    +    leak when reading data from a submodule via git-grep(1):
     
           Direct leak of 192 byte(s) in 1 object(s) allocated from:
             #0 0x55555562e726 in calloc (git+0xda726)
Previous: Eric SunshineNext: Eric Sunshine
Message 10 of 26 in “Some random object database related fixes”
  1. 0/3 Some random object database related fixesPatrick Steinhardt, Dec 5, 2025
  2. 1/3 builtin/repack: fix geometric repacks with promisor remotesPatrick Steinhardt, Dec 5, 2025
  3. Justin ToblerDec 10, 2025
  4. Patrick SteinhardtDec 11, 2025
  5. 2/3 builtin/gc: fix condition for whether to write commit graphsPatrick Steinhardt, Dec 5, 2025
  6. Justin ToblerDec 10, 2025
  7. Patrick SteinhardtDec 11, 2025
  8. 3/3 odb: properly close sources before freeing themPatrick Steinhardt, Dec 5, 2025
  9. Eric SunshineDec 5, 2025
  10. Patrick SteinhardtDec 6, 2025
  11. Eric SunshineDec 6, 2025
  12. Patrick SteinhardtDec 6, 2025
  13. 0/2 Some random object database related fixesPatrick Steinhardt, Dec 11, 2025
  14. 1/2 builtin/gc: fix condition for whether to write commit graphsPatrick Steinhardt, Dec 11, 2025
  15. Toon ClaesDec 11, 2025
  16. Karthik NayakJan 6, 2026
  17. Patrick SteinhardtJan 6, 2026
  18. Karthik NayakJan 6, 2026
  19. 2/2 odb: properly close sources before freeing themPatrick Steinhardt, Dec 11, 2025
  20. Justin ToblerDec 12, 2025
  21. Karthik NayakJan 6, 2026
  22. 0/2 Some random object database related fixesPatrick Steinhardt, Jan 6, 2026
  23. 1/2 builtin/gc: fix condition for whether to write commit graphsPatrick Steinhardt, Jan 6, 2026
  24. 2/2 odb: properly close sources before freeing themPatrick Steinhardt, Jan 6, 2026
  25. Karthik NayakJan 6, 2026
  26. Junio C HamanoJan 7, 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.