File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
test/sanitizer_common/TestCases/Linux Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments