Skip to content

[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

Merged
merged 4 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler-rt/lib/lsan/lsan_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/hwasan/TestCases/Posix/dlerror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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();
Expand Down
Loading