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

Re: [PATCH] t0613: mark as leak-free

From
Jeff King <peff@peff.net>
Date
Jul 23, 2024, 21:03 UTC
Message-ID
<20240723210339.GD6779@coredump.intra.peff.net>
In-Reply-To
<Zp4gILfskdpc6RUk@tanuki>
On Mon, Jul 22, 2024 at 11:02:24AM +0200, Patrick Steinhardt wrote:
Show 7 quoted lines
> > I'd noticed it, too, while doing recent leak fixes. But since Patrick
> > has been working on leaks and is the go-to person for reftables, I
> > assumed he had already seen it and there was something clever going on. ;)
> 
> Nah, you assumed too much :) I just forgot to mark this as leak-free and
> the topic crossed with my memory-leak-fix topics, so I didn't yet find
> the time to fix it.
Ah, OK. :) Then I think we did the right thing in your absence.
Show 11 quoted lines
> It does highlight an issue though: I think memory leak checks should be
> opt-out rather than opt-in by now. Most of our tests run just fine with
> the memory leak checker enabled, and that's also where we want to be
> headed. So making tests opt-out would likely raise more eyebrows when
> new tests are being added that explicitly opt out.
> 
> The only reason I didn't send a patch like this yet is that it would of
> course create quite a bit of churn in our tests. I'm not sure whether
> that churn is really worth it, or whether we should instead just
> continue fixing tests until we can get rid of this marking altogether
> because all of our tests pass.

I could see arguments in both directions. I'd worry that by switching the default to "assume leak free", it may end up with misalignment between who introduces the bug and who deals with the fallout.

Right now, if I introduce a test that is leak free but don't mark it, somebody working on leaks later runs in check mode and says "yay, it passes. Let's mark it". It becomes their task to do, but it's an easy-ish task.

If we go the other way, then a new test that _does_ leak means that either:

  1. The original author notices the CI leaks job failing.
     a. They introduced the leak, and it was caught early. Yay!
     b. The leak is in some random part of Git that their test happened
	to trigger. Now they spend effort proving it was not their fault
	before they annotate the test with "does not pass leak".
  2. The original author does not notice. Somebody notices later when
     doing leak-checking (or I guess just running their own CI, if we
     are hitting these by default). Now they are stuck with doing (1a)
     or (1b) themselves, even though they do not care about the original
     topic.

So I dunno. If we think people are paying attention to CI on their topics, and we think that we are close enough to leak-free that (1b) won't come up a lot, it might make sense. I'm not quite sure we're there yet on the latter, but it's mostly gut feeling (and I know things have gotten a bit better recently, too).

I guess the only way to know is to try it, but as you noted, it is a bit of churn to switch between the two states.

-Peff
Previous: Patrick SteinhardtNext: Rubén Justo
Message 8 of 11 in “t0613: mark as leak-free”
  1. t0613: mark as leak-freeRubén Justo, Jun 30, 2024
  2. Jeff KingJul 1, 2024
  3. Rubén JustoJul 1, 2024
  4. t0612: mark as leak-freeRubén Justo, Jul 1, 2024
  5. Eric SunshineJul 1, 2024
  6. t0612: mark as leak-freeRubén Justo, Jul 1, 2024
  7. Patrick SteinhardtJul 22, 2024
  8. Jeff KingJul 23, 2024
  9. Re* [PATCH] t0613: mark as leak-freeRubén Justo, Jul 23, 2024
  10. Patrick SteinhardtJul 24, 2024
  11. Rubén JustoJul 24, 2024

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.