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

Re: a less-invasive racy-leak fix, was Re: What's cooking in git.git (Dec 2024, #11; Mon, 30)

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 2, 2025, 00:25 UTC
Message-ID
<xmqqa5cavz8h.fsf@gitster.g>
In-Reply-To
<20250101191422.GC1391912@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> On Mon, Dec 30, 2024 at 09:33:20AM -0800, Junio C Hamano wrote:
>
>> * jk/lsan-race-with-barrier (2024-12-30) 5 commits
> ...
> This graduated faster than I expected. :)
Heh, it is before -rc2 and the change is only about tests, so ...
Show 27 quoted lines
> ...
> So that line is doing something useful. But it may not be worth the racy
> pain it's causing. So some alternatives are:
>
>   - we drop that line by default, and then when people are investigating
>     a specific leak, they can override LSAN_OPTIONS themselves to get
>     better output (though of course knowing that you can even do is
>     tricky)
>
>   - we keep that line by default, but override LSAN_OPTIONS for CI to
>     avoid the race. That makes all local leak-checking traces
>     informative by default. But CI ones may be truncated. I'm not sure
>     if people use the CI ones directly, or investigate further
>     themselves.
>
>   - we could annotate individual scripts or even tests to disable the
>     option (since it's really just threaded programs). This is more
>     hassle, but would limit the blast radius.
>
> I don't love any of those, but they may be less bad than all of the
> barrier trickery. And it may be that this is even something we could get
> fixed in LSan upstream, and it would just be a temporary workaround. I'm
> still going to pursue that.
>
> And finally, one other option (that I'm not sure why I didn't consider
> before): can we just ignore the false positives, similar to what we did
> in 370ef7e40d (test-lib: ignore uninteresting LSan output, 2023-08-28).
Good point.
Show 8 quoted lines
> I think we'd have to stop doing abort_on_error for the leak checker and
> just rely on the logs, but that's OK (we always check the logs these
> days).
> ...
> A little hacky, but it lets us have our cake and eat it, too. No changes
> to the code, and no bad stack traces.
>
> What do you think?

I like the small hack. "This is ultimately LSan's racy-ness and not ours, so let's avoid changing our code to work it around when we can do the workaround somewhere else" is an attitude that I would endorse fully.

Thanks.
Previous: Patrick SteinhardtNext: Jeff King
Message 31 of 37 in “What's cooking in git.git (Dec 2024, #11; Mon, 30)”
  1. Junio C HamanoDec 30, 2024
  2. René ScharfeDec 31, 2024
  3. Patrick SteinhardtJan 3, 2025
  4. a less-invasive racy-leak fix, was Re: What's cooking in git.git (Dec 2024, #11; Mon, 30)Jeff King, Jan 1, 2025
  5. 0/6 a less-invasive racy-leak fixJeff King, Jan 1, 2025
  6. 1/6 test-lib: use individual lsan dir for --stress runsJeff King, Jan 1, 2025
  7. 2/6 Revert "index-pack: spawn threads atomically"Jeff King, Jan 1, 2025
  8. 3/6 test-lib: rely on logs to detect leaksJeff King, Jan 1, 2025
  9. Patrick SteinhardtJan 3, 2025
  10. Jeff KingJan 3, 2025
  11. 4/6 test-lib: simplify leak-log checkingJeff King, Jan 1, 2025
  12. Patrick SteinhardtJan 3, 2025
  13. Jeff KingJan 3, 2025
  14. Patrick SteinhardtJan 6, 2025
  15. Jeff KingJan 7, 2025
  16. 5/6 test-lib: check leak logs for presence of DEDUP_TOKENJeff King, Jan 1, 2025
  17. 6/6 test-lib: ignore leaks in the sanitizer's thread codeJeff King, Jan 1, 2025
  18. Patrick SteinhardtJan 3, 2025
  19. Jeff KingJan 3, 2025
  20. Patrick SteinhardtJan 6, 2025
  21. 0/3 lsan test-lib readabilityJeff King, Jan 7, 2025
  22. 1/3 test-lib: invert return value of check_test_results_san_file_emptyJeff King, Jan 7, 2025
  23. 2/3 test-lib: simplify lsan results checkJeff King, Jan 7, 2025
  24. Patrick SteinhardtJan 7, 2025
  25. Jeff KingJan 9, 2025
  26. Patrick SteinhardtJan 9, 2025
  27. Junio C HamanoJan 7, 2025
  28. Jeff KingJan 9, 2025
  29. 3/3 test-lib: add a few comments to LSan log checkingJeff King, Jan 7, 2025
  30. Patrick SteinhardtJan 7, 2025
  31. Junio C HamanoJan 2, 2025
  32. Jeff KingJan 2, 2025
  33. Chris TorekJan 2, 2025
  34. Junio C HamanoJan 2, 2025
  35. Jeff KingJan 2, 2025
  36. Junio C HamanoJan 2, 2025
  37. Jeff KingJan 2, 2025

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.