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

Re: gitk regression in version 2.36.0

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 23, 2022, 16:00 UTC
Message-ID
<xmqqh76j3i3r.fsf@gitster.g>
In-Reply-To
<737bd2f8-dfd7-6a51-b7f5-33eefa33e975@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 9 quoted lines
>> I am reasonably sure that reverting that commit will be the right
>> thing to do.  It is somewhat unfortunate that it would reintroduce
>> resource leaks that having clear_pathspec() in a wrong place (i.e.
>> diff_free()) was covering up.  We should instead need to find the
>> place where a diff_opt struct goes out of scope (after being used
>> for zero or more times, calling diff_free() after each iteration to
>> release resources consumed per-iteration) and call clear_pathspec().
>
> Right; a small memory leak is better than wrong output.

Yeah, it is an absolute requirement to avoid producing wrong output, and when producing output for 100 or 1000 commits, we should not leak resources in proportion to the number of these commits processed, so forgetting to call diff_free() that releases resources that are required per diff-invocation is also a must. Compared to that, cleaning up the resource allocated just once and repeatedly used while we handle these 100 or 1000 commits, while it is nice to do so, is of much lower priority, certainly much lower than computing the right result.

> Finding those places is a bit complicated by diff_options often being
> embedded in struct rev_info, though.

Perhaps, but we should have a resource-releasing helper for rev_info, so that may be a good place to do so, hopefully.

Thanks
> PS: And I need to learn to download new posts before hitting Send
> (or become faster); sorry for my near-duplicate reply.

Actually this time I very much appreciated an independent validation of my findings ;-) Thanks.

Previous: René ScharfeNext: Junio C Hamano
Message 5 of 16 in “gitk regression in version 2.36.0”
  1. Matthias AßhauerApr 23, 2022
  2. Junio C HamanoApr 23, 2022
  3. Junio C HamanoApr 23, 2022
  4. René ScharfeApr 23, 2022
  5. Junio C HamanoApr 23, 2022
  6. 2.36 gitk/diff-tree --stdin regression fixJunio C Hamano, Apr 25, 2022
  7. t4013: diff-tree --stdin with pathspecJunio C Hamano, Apr 25, 2022
  8. Phillip WoodApr 26, 2022
  9. Phillip WoodApr 26, 2022
  10. Junio C HamanoApr 26, 2022
  11. Junio C HamanoApr 26, 2022
  12. 2.36 gitk/diff-tree --stdin regression fixJunio C Hamano, Apr 26, 2022
  13. René ScharfeApr 27, 2022
  14. René ScharfeApr 27, 2022
  15. Junio C HamanoApr 27, 2022
  16. René ScharfeApr 23, 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.