Skip to content

Commit 3e3d74a

Browse files
committed
Reapply "[sanitizer] Skip /include/c++/ from summary (#78534)"
Keep linux only test. This reverts commit 4619147.
1 parent 15b089c commit 3e3d74a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ 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/")))
37+
if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
38+
internal_strstr(file, "/include/c++/")))
3839
return true;
3940
if (module && (internal_strstr(module, "libclang_rt.")))
4041
return true;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Test the behavior of malloc called from std:: when the allocation size
2+
// exceeds the sanitizer's allocator max allowed one.
3+
4+
// RUN: %clangxx -O0 %s -o %t
5+
// RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s
6+
7+
// UBSAN has no allocator.
8+
// UNSUPPORTED: ubsan
9+
10+
// REQUIRES: x86_64-target-arch
11+
12+
#include <stdio.h>
13+
#include <stdlib.h>
14+
#include <vector>
15+
16+
int main(int argc, char **argv) {
17+
// The maximum value of all supported sanitizers (search for
18+
// kMaxAllowedMallocSize). For ASan + LSan, ASan limit is used.
19+
constexpr size_t kMaxAllowedMallocSizePlusOne = (1ULL << 40) + 1;
20+
21+
std::vector<char> v;
22+
v.resize(kMaxAllowedMallocSizePlusOne);
23+
24+
fprintf(stderr, "x: %lx\n", (long)v.data());
25+
26+
return 0;
27+
}
28+
29+
// CHECK: #{{[0-9]+.*}}allocator_returns_null_std.cpp
30+
// CHECK: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null_std.cpp.*}} in main

0 commit comments

Comments
 (0)