diff options
author | Hans Wennborg <hans@chromium.org> | 2024-01-19 10:59:05 +0100 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2024-01-19 10:59:05 +0100 |
commit | 4619147911c2a955bb605618bc518b45da994a81 (patch) | |
tree | 39b1c8c52d8e8e24ea9b13c4e1dbbbbd8f8de0e8 /compiler-rt | |
parent | 10317da20309378365e116ce5d4f87c40d6ad25d (diff) | |
download | llvm-4619147911c2a955bb605618bc518b45da994a81.zip llvm-4619147911c2a955bb605618bc518b45da994a81.tar.gz llvm-4619147911c2a955bb605618bc518b45da994a81.tar.bz2 |
Revert "[sanitizer] Skip /include/c++/ from summary (#78534)"
The test fails on Darwin, see comment on the PR.
> std:: usually is not a cause of the bug.
>
> We now display
> ```
> SUMMARY: AddressSanitizer: allocation-size-too-big path/to/allocator_returns_null.cpp:92:7 in main
> ```
> instead of
>
> ```
> SUMMARY: AddressSanitizer: allocation-size-too-big /usr/lib/../include/c++/13/bits/new_allocator.h:147:27 in std::__new_allocator<char>::allocate(unsigned long, void const*)
> ```
>
> `/include/c++/` matches both libc++ and libstdc++ include paths.
This reverts commit ecd47811b755d13357085bcd7519a66d6c4d8e5c.
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp | 3 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp | 19 |
2 files changed, 3 insertions, 19 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp index 8438e01..253dc10 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp @@ -34,8 +34,7 @@ static bool FrameIsInternal(const SymbolizedStack *frame) { return true; const char *file = frame->info.file; const char *module = frame->info.module; - if (file && (internal_strstr(file, "/compiler-rt/lib/") || - internal_strstr(file, "/include/c++/"))) + if (file && (internal_strstr(file, "/compiler-rt/lib/"))) return true; if (module && (internal_strstr(module, "libclang_rt."))) return true; diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp index 1e4b0ed..ca6f637 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp @@ -34,20 +34,17 @@ // RUN: | FileCheck %s --check-prefix=CHECK-nnCRASH // RUN: %env_tool_opts=allocator_may_return_null=1 %run %t new-nothrow 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-NULL -// RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t vector 2>&1 \ -// RUN: | FileCheck %s --check-prefix=CHECK-vCRASH // TODO(alekseyshl): win32 is disabled due to failing errno tests, fix it there. // UNSUPPORTED: ubsan, target={{.*windows-msvc.*}} #include <assert.h> #include <errno.h> -#include <limits> -#include <new> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <vector> +#include <limits> +#include <new> int main(int argc, char **argv) { assert(argc == 2); @@ -63,8 +60,6 @@ int main(int argc, char **argv) { (3UL << 30) + 1; #endif - std::vector<char> v; - void *x = nullptr; if (!strcmp(action, "malloc")) { x = malloc(kMaxAllowedMallocSizePlusOne); @@ -87,14 +82,6 @@ int main(int argc, char **argv) { x = operator new(kMaxAllowedMallocSizePlusOne); } else if (!strcmp(action, "new-nothrow")) { x = operator new(kMaxAllowedMallocSizePlusOne, std::nothrow); - } else if (!strcmp(action, "vector")) { -#if __LP64__ || defined(_WIN64) - v.resize(kMaxAllowedMallocSizePlusOne); - x = v.data(); -#else - // Fake it: 32bit fails early in std. - x = malloc(kMaxAllowedMallocSizePlusOne); -#endif } else { assert(0); } @@ -130,8 +117,6 @@ int main(int argc, char **argv) { // CHECK-nnCRASH: new-nothrow: // CHECK-nnCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp // CHECK-nnCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main -// CHECK-vCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp -// CHECK-vCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main // CHECK-NULL: {{malloc|calloc|calloc-overflow|realloc|realloc-after-malloc|new-nothrow}} // CHECK-NULL: errno: 12, x: 0 |