Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AK+LibMain: Perform LSAN checks ahead of process shutdown #2624

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

trflynn89
Copy link
Contributor

@trflynn89 trflynn89 commented Nov 28, 2024

From the documentation of __lsan_do_leak_check:

By calling this function early during process shutdown, you can
instruct LSan to ignore shutdown-only leaks which happen later on.

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 the GC::Function hasn't been GCd yet?)

Example run:
https://github.com/trflynn89/ladybird/actions/runs/12073052461/job/33668363256#step:17:1851

There aren't any exact spec steps to follow here, but let's ensure the
underlying video source is actually stopped.
From the documentation of __lsan_do_leak_check:

    By calling this function early during process shutdown, you can
    instruct LSan to ignore shutdown-only leaks which happen later on.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant