AK+LibMain: Perform LSAN checks ahead of process shutdown #2624
+30
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the documentation of __lsan_do_leak_check:
We currently have tens of thousands of lines of LSAN output at the end
of each LibWeb test run on CI. May of these are expected leaks; e.g. we
load a bunch of fonts at WebContent process start and just hold on to
them statically, until process exit.
By calling this LSAN method just before we exit from LibMain's main(),
we get a much shorter report of what appear to be more legit leaks.
Two such reported leaks are fixed here. But in the first commit, it's not clear to me why that URL leaks - is
GC::Function
keeping it alive? (maybe theGC::Function
hasn't been GCd yet?)Example run:
https://github.com/trflynn89/ladybird/actions/runs/12073052461/job/33668363256#step:17:1851