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

jk/diff-files-cleanup-fix + related un-picked-up ab/* (was: What's cooking in git.git (Jul 2022, #05; Sun, 17))

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 18, 2022, 10:15 UTC
Message-ID
<220718.86h73eyb31.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqq7d4bt8n4.fsf@gitster.g>
On Sun, Jul 17 2022, Junio C Hamano wrote:
Show 9 quoted lines
> * jk/diff-files-cleanup-fix (2022-07-12) 1 commit
>   (merged to 'next' on 2022-07-13 at 9db5235d01)
>  + diff-files: move misplaced cleanup label
>
>  An earlier attempt to plug leaks placed a clean-up label to jump to
>  at a bogus place, which as been corrected.
>
>  Will merge to 'master'.
>  source: <Ys0c0ePxPOqZ/5ck@coredump.intra.peff.net>
(As noted before) that fix looks good, thanks Jeff!

But here's a gentle *poke* about picking up [1], which is a related follow-up series (but applies directly on master).

It fixes some other minor issues in my earlier release_revisions() series, and then goes on to fix other common memory leaks that didn't make it into that initial series.

These in particular & somewhat tricky or non-obvious, and could use careful review:

    https://lore.kernel.org/git/patch-4.6-9bff7b10197-20220713T130511Z-avarab@gmail.com/
    https://lore.kernel.org/git/patch-6.6-4a581a4a6ce-20220713T130511Z-avarab@gmail.com/

The latter of those proposes to fix what's a common leak pattern in the codebase in a particular way, I'd be interested to know what people think of that approach.

There was a related earlier discussion between me and Glen at:
	https://lore.kernel.org/git/220713.86o7xs3g76.gmgdl@evledraar.gmail.com/

I.e. whether we should do an xstrdup() (or equivalent) in those cases, so we wouldn't have to mix up free()-able data (strvec etc) with un-free() able (main()'s "argv") in various APIs.

There are more drastic ways to address it, but I think that 6/6 is the best trade-off in terms of a narrow fix & fixing that class of leak.

1. https://lore.kernel.org/git/cover-0.6-00000000000-20220713T130511Z-avarab@gmail.com/
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 3 of 6 in “What's cooking in git.git (Jul 2022, #05; Sun, 17)”
  1. Junio C HamanoJul 18, 2022
  2. zh/ls-files-format (was: What's cooking in git.git (Jul 2022, #05; Sun, 17))Ævar Arnfjörð Bjarmason, Jul 18, 2022
  3. jk/diff-files-cleanup-fix + related un-picked-up ab/* (was: What's cooking in git.git (Jul 2022, #05; Sun, 17))Ævar Arnfjörð Bjarmason, Jul 18, 2022
  4. Junio C HamanoJul 18, 2022
  5. Victoria DyeJul 18, 2022
  6. Junio C HamanoJul 18, 2022

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.