From 7ec16f4e9f1c5c3a97ecd0f1d51106c3849fa3fc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 1 Jul 2026 21:45:47 +0200 Subject: [PATCH] chore: Update macOS test-leaks configuration Use the Apple Silicon Homebrew LLVM path for the test-leaks compiler configuration. Keep the LSan suppressions for known macOS system-library leak reports so the target remains focused on sentry-native leaks. --- Makefile | 8 ++++---- tests/leaks.txt | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7e0f33b45e..5a2550964f 100644 --- a/Makefile +++ b/Makefile @@ -40,12 +40,12 @@ test-leaks: update-test-discovery CMakeLists.txt -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(PWD)/leak-build \ -DSENTRY_BACKEND=none \ -DWITH_ASAN_OPTION=ON \ - -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \ - -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \ - -DCMAKE_LINKER=/usr/local/opt/llvm/bin/clang \ + -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \ + -DCMAKE_LINKER=/opt/homebrew/opt/llvm/bin/clang \ .. @cmake --build leak-build --target sentry_test_unit --parallel - @ASAN_OPTIONS=detect_leaks=1 ./leak-build/sentry_test_unit + @LSAN_OPTIONS=suppressions=$(PWD)/tests/leaks.txt:print_suppressions=0 ASAN_OPTIONS=detect_leaks=1 ./leak-build/sentry_test_unit .PHONY: test-leaks benchmark: setup-venv diff --git a/tests/leaks.txt b/tests/leaks.txt index 7e4d81e043..be7dfb5aa8 100644 --- a/tests/leaks.txt +++ b/tests/leaks.txt @@ -12,4 +12,16 @@ leak:SCDynamicStoreCopyProxiesWithOptions # I cannot reproduce it with the current brew llvm package (18.1.7). TODO: remove when GHA macOS runner image updates the llvm package. leak:realizeClassWithoutSwift -leak:Curl_getaddrinfo_ex \ No newline at end of file +leak:Curl_getaddrinfo_ex + +# macOS notify framework false positives from fork() during tests. +# The notify framework re-allocates internal data structures in the child +# process after fork(), which LSan reports as leaks since the parent's +# pointers are gone. Upstream: https://github.com/google/sanitizers/issues/764 +leak:os_set_*_ptr_init +leak:os_map_*_init + +# macOS Objective-C runtime false positive from _fetchInitializingClassList. +# Triggered during lazy class initialization in CoreFoundation/CFNumber. +# Upstream: https://github.com/google/sanitizers/issues/1781 +leak:_fetchInitializingClassList