-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[NFC][sanitizer] Commit test for #106912 #108289
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
vitalybuka
merged 7 commits into
main
from
users/vitalybuka/spr/nfcsanitizer-commit-test-for-106912
Sep 11, 2024
Merged
[NFC][sanitizer] Commit test for #106912 #108289
vitalybuka
merged 7 commits into
main
from
users/vitalybuka/spr/nfcsanitizer-commit-test-for-106912
Sep 11, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) ChangesAlmost all sanitizers already support the test.
Full diff: https://github.com/llvm/llvm-project/pull/108289.diff 1 Files Affected:
diff --git a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
new file mode 100644
index 00000000000000..9d61a30d22c1bf
--- /dev/null
+++ b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
@@ -0,0 +1,49 @@
+// RUN: %clangxx -O0 -pthread %s -o %t && %run %t
+
+// FIXME: TSAN does not use DlsymAlloc.
+// UNSUPPORTED: tsan
+
+// FIXME: https://github.com/llvm/llvm-project/pull/106912
+// XFAIL: lsan
+
+#include <stdlib.h>
+
+const char *test() __attribute__((disable_sanitizer_instrumentation)) {
+ void * volatile p = malloc(3);
+ p = realloc(p, 7);
+ free(p);
+
+ p = calloc(3, 7);
+ free(p);
+
+ free(nullptr);
+
+ return "";
+}
+
+extern "C" const char *__asan_default_options()
+ __attribute__((disable_sanitizer_instrumentation)) {
+ return test();
+}
+
+extern "C" const char *__lsan_default_options()
+ __attribute__((disable_sanitizer_instrumentation)) {
+ return test();
+}
+
+extern "C" const char *__msan_default_options()
+ __attribute__((disable_sanitizer_instrumentation)) {
+ return test();
+}
+
+extern "C" const char *__tsan_default_options()
+ __attribute__((disable_sanitizer_instrumentation)) {
+ return test();
+}
+
+extern "C" const char *__hwasan_default_options()
+ __attribute__((disable_sanitizer_instrumentation)) {
+ return test();
+}
+
+int main(int argc, char **argv) { return 0; }
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Created using spr 1.3.4
tmiasko
approved these changes
Sep 11, 2024
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
Jan 13, 2025
Almost all sanitizers already support the test. * Tsan does not use DlsymAlloc yet. * Lsan will support with llvm#106912. memprof,rtsan,nsan are not tested as part of sanitizer_common, but we should keep them here to show up when it happen. --------- Co-authored-by: Xiaofeng Tian <[email protected]> (cherry picked from commit 1797174)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Almost all sanitizers already support the test.
memprof,rtsan,nsan are not tested as part of
sanitizer_common, but we should keep them here to
show up when it happen.