-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LSan] skip leaks from dlerror #142876
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
[LSan] skip leaks from dlerror #142876
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Florian Mayer (fmayer) ChangesWe have known false positives, and the return value is never Full diff: https://github.com/llvm/llvm-project/pull/142876.diff 2 Files Affected:
diff --git a/compiler-rt/lib/lsan/lsan_common.cpp b/compiler-rt/lib/lsan/lsan_common.cpp
index 7ab9e4ff2ac9f..b17a17e1193bc 100644
--- a/compiler-rt/lib/lsan/lsan_common.cpp
+++ b/compiler-rt/lib/lsan/lsan_common.cpp
@@ -124,7 +124,8 @@ static const char kStdSuppressions[] =
# endif
// TLS leak in some glibc versions, described in
// https://sourceware.org/bugzilla/show_bug.cgi?id=12650.
- "leak:*tls_get_addr*\n";
+ "leak:*tls_get_addr*\n"
+ "leak:*dlerror*\n";
void InitializeSuppressions() {
CHECK_EQ(nullptr, suppression_ctx);
diff --git a/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp b/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
index 15455ba5af780..b6e486b291f3a 100644
--- a/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
+++ b/compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
@@ -2,7 +2,6 @@
// This is currently not implemented, so this test is XFAIL.
// RUN: %clangxx_hwasan -O0 %s -o %t && HWASAN_OPTIONS=detect_leaks=1 %run %t
-// XFAIL: *
#include <assert.h>
#include <dlfcn.h>
@@ -12,7 +11,8 @@
#include <string.h>
#include <unistd.h>
-constexpr auto kKeys = 500;
+// musl only has 128 keys
+constexpr auto kKeys = 100;
int main(int argc, char **argv) {
__hwasan_enable_allocator_tagging();
|
There's a flag:
Obviously we shouldn't use this flag, but I wonder if something like that would be better than specifically suppressing |
Yeah, it would be better to fix the root cause. But until then, this exclusion makes sense IMO. WDYT? |
SGTM. |
Created using spr 1.3.4 [skip ci]
We have known false positives, and the return value is never user-managed anyway.
We have known false positives, and the return value is never user-managed anyway.
We have known false positives, and the return value is never
user-managed anyway.