[compiler-rt] r206262 - [asan] try fixing the mmap_limit_mb failure on buildbot (tests pass locally)
Kostya Serebryany
kcc at google.com
Tue Apr 15 01:35:43 PDT 2014
Author: kcc
Date: Tue Apr 15 03:35:43 2014
New Revision: 206262
URL: http://llvm.org/viewvc/llvm-project?rev=206262&view=rev
Log:
[asan] try fixing the mmap_limit_mb failure on buildbot (tests pass locally)
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/trunk/test/asan/TestCases/mmap_limit_mb.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=206262&r1=206261&r2=206262&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Tue Apr 15 03:35:43 2014
@@ -252,8 +252,9 @@ void IncreaseTotalMmap(uptr size) {
atomic_fetch_add(&g_total_mmaped, size, memory_order_relaxed) + size;
if ((total_mmaped >> 20) > common_flags()->mmap_limit_mb) {
// Since for now mmap_limit_mb is not a user-facing flag, just CHECK.
+ uptr mmap_limit_mb = common_flags()->mmap_limit_mb;
common_flags()->mmap_limit_mb = 0; // Allow mmap in CHECK.
- CHECK_LT(total_mmaped >> 20, common_flags()->mmap_limit_mb);
+ CHECK_LT(total_mmaped >> 20, mmap_limit_mb);
}
}
Modified: compiler-rt/trunk/test/asan/TestCases/mmap_limit_mb.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/mmap_limit_mb.cc?rev=206262&r1=206261&r2=206262&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/mmap_limit_mb.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/mmap_limit_mb.cc Tue Apr 15 03:35:43 2014
@@ -3,8 +3,8 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %t 100 16
// RUN: %t 100 1000000
-// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 100 16
-// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 100 1000000
+// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 50 16
+// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 50 1000000
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %t 500 16 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %t 500 1000000 2>&1 | FileCheck %s
@@ -19,12 +19,14 @@ int main(int argc, char **argv) {
assert(argc == 3);
long total_mb = atoi(argv[1]);
long allocation_size = atoi(argv[2]);
+ fprintf(stderr, "total_mb: %zd allocation_size: %zd\n", total_mb,
+ allocation_size);
std::vector<char *> v;
for (long total = total_mb << 20; total > 0; total -= allocation_size)
v.push_back(new char[allocation_size]);
for (std::vector<char *>::const_iterator it = v.begin(); it != v.end(); ++it)
delete[](*it);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
// CHECK: AddressSanitizer CHECK failed{{.*}}total_mmaped{{.*}}mmap_limit_mb
return 0;
}
More information about the llvm-commits
mailing list