Skip to content

Commit 4619147

Browse files
committed
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 ecd4781.
1 parent 10317da commit 4619147

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
3434
return true;
3535
const char *file = frame->info.file;
3636
const char *module = frame->info.module;
37-
if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
38-
internal_strstr(file, "/include/c++/")))
37+
if (file && (internal_strstr(file, "/compiler-rt/lib/")))
3938
return true;
4039
if (module && (internal_strstr(module, "libclang_rt.")))
4140
return true;

compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,17 @@
3434
// RUN: | FileCheck %s --check-prefix=CHECK-nnCRASH
3535
// RUN: %env_tool_opts=allocator_may_return_null=1 %run %t new-nothrow 2>&1 \
3636
// RUN: | FileCheck %s --check-prefix=CHECK-NULL
37-
// RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t vector 2>&1 \
38-
// RUN: | FileCheck %s --check-prefix=CHECK-vCRASH
3937

4038
// TODO(alekseyshl): win32 is disabled due to failing errno tests, fix it there.
4139
// UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
4240

4341
#include <assert.h>
4442
#include <errno.h>
45-
#include <limits>
46-
#include <new>
4743
#include <stdio.h>
4844
#include <stdlib.h>
4945
#include <string.h>
50-
#include <vector>
46+
#include <limits>
47+
#include <new>
5148

5249
int main(int argc, char **argv) {
5350
assert(argc == 2);
@@ -63,8 +60,6 @@ int main(int argc, char **argv) {
6360
(3UL << 30) + 1;
6461
#endif
6562

66-
std::vector<char> v;
67-
6863
void *x = nullptr;
6964
if (!strcmp(action, "malloc")) {
7065
x = malloc(kMaxAllowedMallocSizePlusOne);
@@ -87,14 +82,6 @@ int main(int argc, char **argv) {
8782
x = operator new(kMaxAllowedMallocSizePlusOne);
8883
} else if (!strcmp(action, "new-nothrow")) {
8984
x = operator new(kMaxAllowedMallocSizePlusOne, std::nothrow);
90-
} else if (!strcmp(action, "vector")) {
91-
#if __LP64__ || defined(_WIN64)
92-
v.resize(kMaxAllowedMallocSizePlusOne);
93-
x = v.data();
94-
#else
95-
// Fake it: 32bit fails early in std.
96-
x = malloc(kMaxAllowedMallocSizePlusOne);
97-
#endif
9885
} else {
9986
assert(0);
10087
}
@@ -130,8 +117,6 @@ int main(int argc, char **argv) {
130117
// CHECK-nnCRASH: new-nothrow:
131118
// CHECK-nnCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp
132119
// CHECK-nnCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main
133-
// CHECK-vCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp
134-
// CHECK-vCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main
135120

136121
// CHECK-NULL: {{malloc|calloc|calloc-overflow|realloc|realloc-after-malloc|new-nothrow}}
137122
// CHECK-NULL: errno: 12, x: 0

0 commit comments

Comments
 (0)