[compiler-rt] [LSan] Use exit caller SP for explicit exit leak checks (PR #195238)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 1 01:49:17 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- compiler-rt/test/lsan/TestCases/Linux/exit_atexit_stale_stack.cpp compiler-rt/lib/asan/asan_interceptors.cpp compiler-rt/lib/hwasan/hwasan_interceptors.cpp compiler-rt/lib/lsan/lsan_common.cpp compiler-rt/lib/lsan/lsan_common.h compiler-rt/lib/lsan/lsan_interceptors.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/lsan/lsan_interceptors.cpp b/compiler-rt/lib/lsan/lsan_interceptors.cpp
index 3440e4e3f..17b3755a0 100644
--- a/compiler-rt/lib/lsan/lsan_interceptors.cpp
+++ b/compiler-rt/lib/lsan/lsan_interceptors.cpp
@@ -573,9 +573,9 @@ INTERCEPTOR(void, exit, int status) {
REAL(exit)(status);
}
-#define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name)
-#define SIGNAL_INTERCEPTOR_ENTER() ENSURE_LSAN_INITED
-#include "sanitizer_common/sanitizer_signal_interceptors.inc"
+# define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name)
+# define SIGNAL_INTERCEPTOR_ENTER() ENSURE_LSAN_INITED
+# include "sanitizer_common/sanitizer_signal_interceptors.inc"
#endif // SANITIZER_POSIX
diff --git a/compiler-rt/test/lsan/TestCases/Linux/exit_atexit_stale_stack.cpp b/compiler-rt/test/lsan/TestCases/Linux/exit_atexit_stale_stack.cpp
index c6c9dfbc1..b90de5828 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/exit_atexit_stale_stack.cpp
+++ b/compiler-rt/test/lsan/TestCases/Linux/exit_atexit_stale_stack.cpp
@@ -18,7 +18,7 @@
#include <stdlib.h>
-// This test detects special FN
+// This test detects special FN
// OFF must point to a stack-frame hole that survives until LSan's atexit leak
// check. The exact holes depend on the libc version and generated exit-handler
// stack layout. On glibc 2.39 (Ubuntu 24.04), known working values include 64,
``````````
</details>
https://github.com/llvm/llvm-project/pull/195238
More information about the llvm-commits
mailing list