summaryrefslogtreecommitdiff
path: root/test/asan
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-01-08 01:07:34 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-01-08 01:07:34 +0000
commit726dd54e7c60bc1d3e39f200dbae537c7d3cc612 (patch)
treea895a730c2ad9bec44ea51ac39e67e523c0fb5a0 /test/asan
parent8ebc3668b07fc5cca6010265cd4795443f1c1bea (diff)
downloadcompiler-rt-726dd54e7c60bc1d3e39f200dbae537c7d3cc612.tar.gz
[asan] Support running without /proc
Summary: This patch lets ASan run when /proc is not accessible (ex. not mounted yet). It includes a special test-only flag that emulates this condition in an unpriviledged process. This only matters on Linux, where /proc is necessary to enumerate virtual memory mappings. Reviewers: vitalybuka, pcc, krytarowski Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56141 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan')
-rw-r--r--test/asan/TestCases/Posix/no-fd.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/asan/TestCases/Posix/no-fd.cc b/test/asan/TestCases/Posix/no-fd.cc
index 1c94545c7..b0441e925 100644
--- a/test/asan/TestCases/Posix/no-fd.cc
+++ b/test/asan/TestCases/Posix/no-fd.cc
@@ -9,6 +9,10 @@
#include <stdlib.h>
#include <unistd.h>
+extern "C" const char *__asan_default_options() {
+ return "test_only_emulate_no_memorymap=1";
+}
+
void parent(int argc, char **argv) {
fprintf(stderr, "hello\n");
// CHECK: hello