[PATCH] D37366: Fix check-llvm on kernel 4.9+ with asan or msan

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 18:48:47 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL312303: Fix check-llvm on kernel 4.9+ with asan or msan (authored by vitalybuka).

Repository:
  rL LLVM

https://reviews.llvm.org/D37366

Files:
  llvm/trunk/tools/bugpoint/bugpoint.cpp


Index: llvm/trunk/tools/bugpoint/bugpoint.cpp
===================================================================
--- llvm/trunk/tools/bugpoint/bugpoint.cpp
+++ llvm/trunk/tools/bugpoint/bugpoint.cpp
@@ -50,10 +50,10 @@
     cl::desc("Number of seconds program is allowed to run before it "
              "is killed (default is 300s), 0 disables timeout"));
 
-static cl::opt<int>
-    MemoryLimit("mlimit", cl::init(-1), cl::value_desc("MBytes"),
-                cl::desc("Maximum amount of memory to use. 0 disables check."
-                         " Defaults to 400MB (800MB under valgrind)."));
+static cl::opt<int> MemoryLimit(
+    "mlimit", cl::init(-1), cl::value_desc("MBytes"),
+    cl::desc("Maximum amount of memory to use. 0 disables check. Defaults to "
+             "400MB (800MB under valgrind, 0 with sanitizers)."));
 
 static cl::opt<bool>
     UseValgrind("enable-valgrind",
@@ -169,6 +169,12 @@
       MemoryLimit = 800;
     else
       MemoryLimit = 400;
+#if (LLVM_ADDRESS_SANITIZER_BUILD || LLVM_MEMORY_SANITIZER_BUILD ||            \
+     LLVM_THREAD_SANITIZER_BUILD)
+    // Starting from kernel 4.9 memory allocated with mmap is counted against
+    // RLIMIT_DATA. Sanitizers need to allocate tens of terabytes for shadow.
+    MemoryLimit = 0;
+#endif
   }
 
   BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, UseValgrind,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37366.113501.patch
Type: text/x-patch
Size: 1367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170901/274f37cd/attachment.bin>


More information about the llvm-commits mailing list