ladybird/AK/LsanSuppressions.h
sideshowbarker d13d29ee38 LibWeb: Suppress false-positive LSan report during WebWorker teardown
Problem: For several weeks now, CI Sanitizer runs have been logging
leaked RustCompiledRegex objects in the WebWorker process when a worker
is torn down while an off-thread script compile is still in flight.

Cause: compile_off_thread() (introduced in 4a7dc45b3f) parses and
compiles a fetched top-level script on a ThreadPool worker. The pool's a
process-lifetime singleton whose workers are never joined before exit —
and that leads to LSan reporting a false positive during teardown.

Fix: Suppress the false positive via __lsan_default_suppressions().
2026-06-07 11:34:57 +02:00

23 lines
642 B
C

/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Platform.h>
#ifdef HAS_ADDRESS_SANITIZER
extern "C" {
char const* __lsan_default_suppressions();
char const* __lsan_default_suppressions()
{
// Both Skia and Chromium suppress false positive FontConfig leaks
// https://github.com/google/skia/blob/main/tools/LsanSuppressions.cpp#L20
// https://chromium.googlesource.com/chromium/src/build/+/master/sanitizers/lsan_suppressions.cc#25
return "leak:FcPatternObjectInsertElt\n"
"leak:rust_compile_regex";
}
}
#endif