]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cc
1 // Test that SIGSEGV during leak checking does not crash the process.
2 // RUN: %clangxx_asan -O1 %s -o %t && LSAN_OPTIONS="verbosity=1" not %run %t 2>&1
3 // REQUIRES: leak-detection
7 #include <sanitizer/lsan_interface.h>
9 char data
[10 * 1024 * 1024];
12 void *p
= malloc(10 * 1024 * 1024);
14 mprotect((void*)(((unsigned long)p
+ 4095) & ~4095), 16 * 1024, PROT_NONE
);
15 mprotect((void*)(((unsigned long)data
+ 4095) & ~4095), 16 * 1024, PROT_NONE
);
16 __lsan_do_leak_check();
17 fprintf(stderr
, "DONE\n");
20 // CHECK: Tracer caught signal 11
21 // CHECK: LeakSanitizer has encountered a fatal error