-
Notifications
You must be signed in to change notification settings - Fork 15k
[hwasan] Fix suppression of leaks from dlsym #154073
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
Conversation
Header "lsan/lsan_common.h" is not included, CAN_SANITIZE_LEAKS macro is expanded to 0, so suppression of leaks from dlsym doesn't take effect.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Mingjie Xu (Enna1) ChangesHeader "lsan/lsan_common.h" is not included, CAN_SANITIZE_LEAKS macro is expanded to 0, so suppression of leaks from dlsym doesn't take effect. Full diff: https://github.com/llvm/llvm-project/pull/154073.diff 1 Files Affected:
diff --git a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
index 25ca0a3b0b68e..7609e6cd65b7a 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -14,6 +14,7 @@
#include "hwasan.h"
#include "interception/interception.h"
+#include "lsan/lsan_common.h"
#include "sanitizer_common/sanitizer_allocator_dlsym.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_mallinfo.h"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for this?
Sorry, I don't have a test. This issue is exposed when I add
|
|
As you can see, there are other undefined marcos also evaluated to 0. |
|
This probably can be extended as test compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With or without test it's LGTM
But it could be better with a test.
-Wundef would be nice, but not in this patch |
Header "lsan/lsan_common.h" is not included, CAN_SANITIZE_LEAKS macro is expanded to 0, so suppression of leaks from dlsym doesn't take effect.