[compiler-rt] r225261 - [asan] Bump the self-imposed stack limit from 128k to 256k. PowerPC64

Jay Foad jay.foad at gmail.com
Tue Jan 6 02:01:15 PST 2015


Author: foad
Date: Tue Jan  6 04:01:15 2015
New Revision: 225261

URL: http://llvm.org/viewvc/llvm-project?rev=225261&view=rev
Log:
[asan] Bump the self-imposed stack limit from 128k to 256k. PowerPC64
Linux has 64k pages, so the old limit was only two pages. With ASLR the
initial sp might be right at the start of the second page, so the stack
will immediately grow down into the first page; and if you use all pages
of a limited stack then asan hits a kernel bug to do with how stack
guard pages are reported in /proc/self/maps:
http://lkml.iu.edu//hypermail/linux/kernel/1501.0/01025.html

We should still fix the underlying problems, but in the mean time this
patch makes the test work with 64k pages as well as it does with 4k
pages.

Modified:
    compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc

Modified: compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc?rev=225261&r1=225260&r2=225261&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc Tue Jan  6 04:01:15 2015
@@ -92,7 +92,7 @@ void LimitStackAndReexec(int argc, char
   int res = getrlimit(RLIMIT_STACK, &rlim);
   assert(res == 0);
   if (rlim.rlim_cur == RLIM_INFINITY) {
-    rlim.rlim_cur = 128 * 1024;
+    rlim.rlim_cur = 256 * 1024;
     res = setrlimit(RLIMIT_STACK, &rlim);
     assert(res == 0);
 





More information about the llvm-commits mailing list