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

Re: [PATCH 0/2] dir & unpak-trees: memory-leak fixes

From
Elijah Newren <newren@gmail.com>
Date
Oct 6, 2021, 16:33 UTC
Message-ID
<CABPp-BGsJOtffyLqk85Z65chJkPr+PsZieK=eX57ccKawdVAVQ@mail.gmail.com>
In-Reply-To
<cover-0.2-00000000000-20211006T093405Z-avarab@gmail.com>
On Wed, Oct 6, 2021 at 2:40 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>
> These couple of patches fix some remaining memory leaks in
> unpack-trees.c, which mostly happen via a lack of calls to dir_clear()
> fixed in 2/2.

There is no added dir_clear() in 2/2 (the equivalent patch in the previous series you took that patch from did have one, so I think this was just an incomplete edit-or-commenting-after-rebasing case). More comments on that patch. The idea for 2/2 is probably good, but should probably be accompanied with another tweak, and the commit message and cover letter about it need some updating.

Patch 1/2 is a clear memory leak fix.
Show 32 quoted lines
> This goes on top of ab/sanitize-leak-ci (but not
> en/removing-untracked-fixes). In 1/2 I mark a test as passing under
> SANITIZE=leak, which assumes that an environment variable added by
> ab/sanitize-leak-ci is understood. Without ab/sanitize-leak-ci it'll
> be silently ignored.
>
> Elijah has parallel work in fixing leaks in dir.c, but without his
> ab/sanitize-leak-ci that test will also pass, it's not one of the ones
> that needed something like his leak fixes to {dir,unpack-trees}.c to
> pass.
>
> Ævar Arnfjörð Bjarmason (2):
>   unpack-trees: don't leak memory in verify_clean_subdirectory()
>   built-ins & lib: plug memory leaks with unpack_trees_options_release()
>
>  archive.c                   | 11 ++++++++---
>  builtin/am.c                | 17 ++++++++++++-----
>  builtin/checkout.c          |  9 +++++++--
>  builtin/clone.c             |  1 +
>  builtin/commit.c            |  6 +++++-
>  builtin/merge.c             |  6 ++++--
>  builtin/read-tree.c         | 14 ++++++++++----
>  builtin/reset.c             | 13 +++++++++----
>  builtin/stash.c             | 14 ++++++++++----
>  diff-lib.c                  |  5 ++++-
>  sequencer.c                 |  2 ++
>  t/t1001-read-tree-m-2way.sh |  2 ++
>  unpack-trees.c              |  3 ++-
>  13 files changed, 76 insertions(+), 27 deletions(-)
>
> --
> 2.33.0.1441.gbbcdb4c3c66
Previous: Elijah NewrenNext: Ævar Arnfjörð Bjarmason
Message 6 of 17 in “dir & unpak-trees: memory-leak fixes”
  1. 0/2 dir & unpak-trees: memory-leak fixesÆvar Arnfjörð Bjarmason, Oct 6, 2021
  2. 1/2 unpack-trees: don't leak memory in verify_clean_subdirectory()Ævar Arnfjörð Bjarmason, Oct 6, 2021
  3. Elijah NewrenOct 6, 2021
  4. 2/2 built-ins & lib: plug memory leaks with unpack_trees_options_release()Ævar Arnfjörð Bjarmason, Oct 6, 2021
  5. Elijah NewrenOct 6, 2021
  6. Elijah NewrenOct 6, 2021
  7. 0/3 unpack-trees: memory-leak fixesÆvar Arnfjörð Bjarmason, Oct 7, 2021
  8. 2/3 sequencer: add a "goto cleanup" to do_reset()Ævar Arnfjörð Bjarmason, Oct 7, 2021
  9. Elijah NewrenOct 7, 2021
  10. 1/3 unpack-trees: don't leak memory in verify_clean_subdirectory()Ævar Arnfjörð Bjarmason, Oct 7, 2021
  11. Junio C HamanoOct 7, 2021
  12. 3/3 sequencer: fix a memory leak in do_reset()Ævar Arnfjörð Bjarmason, Oct 7, 2021
  13. Elijah NewrenOct 7, 2021
  14. 0/3 unpack-trees: memory-leak fixesÆvar Arnfjörð Bjarmason, Oct 13, 2021
  15. 1/3 unpack-trees: don't leak memory in verify_clean_subdirectory()Ævar Arnfjörð Bjarmason, Oct 13, 2021
  16. 2/3 sequencer: add a "goto cleanup" to do_reset()Ævar Arnfjörð Bjarmason, Oct 13, 2021
  17. 3/3 sequencer: fix a memory leak in do_reset()Ævar Arnfjörð Bjarmason, Oct 13, 2021

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.