[compiler-rt] r225478 - [asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
Kostya Serebryany
kcc at google.com
Thu Jan 8 15:37:09 PST 2015
Author: kcc
Date: Thu Jan 8 17:37:09 2015
New Revision: 225478
URL: http://llvm.org/viewvc/llvm-project?rev=225478&view=rev
Log:
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
Modified:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc?rev=225478&r1=225477&r2=225478&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc Thu Jan 8 17:37:09 2015
@@ -2,8 +2,8 @@
// RUN: %clangxx -O2 %s -o %t
//
// Run with limit should fail:
-// RUN: %tool_options=soft_rss_limit_mb=400:quarantine_size=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_1
-// RUN: %tool_options=soft_rss_limit_mb=400:quarantine_size=1:allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0
+// RUN: %tool_options=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_1
+// RUN: %tool_options=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0
// FIXME: make it work for other sanitizers.
// XFAIL: lsan
@@ -14,8 +14,8 @@
#include <string.h>
#include <unistd.h>
-static const int kMaxNumAllocs = 1 << 10;
-static const int kAllocSize = 1 << 20; // Large enough to go vi mmap.
+static const int kMaxNumAllocs = 1 << 9;
+static const int kAllocSize = 1 << 20; // Large enough to go via mmap.
static char *allocs[kMaxNumAllocs];
@@ -25,7 +25,7 @@ int main() {
fprintf(stderr, "[%d] allocating %d times\n", i, num_allocs);
int zero_results = 0;
for (int j = 0; j < num_allocs; j++) {
- if ((j % (num_allocs / 4)) == 0) {
+ if ((j % (num_allocs / 8)) == 0) {
usleep(100000);
fprintf(stderr, " [%d]\n", j);
}
@@ -47,16 +47,16 @@ int main() {
}
}
+// CHECK_MAY_RETURN_1: allocating 128 times
+// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: 128
// CHECK_MAY_RETURN_1: allocating 256 times
-// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: 256
-// CHECK_MAY_RETURN_1: allocating 512 times
// CHECK_MAY_RETURN_1: Some of the malloc calls returned null:
// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null:
-// CHECK_MAY_RETURN_1: allocating 1024 times
+// CHECK_MAY_RETURN_1: allocating 512 times
// CHECK_MAY_RETURN_1: Some of the malloc calls returned null:
// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null:
+// CHECK_MAY_RETURN_0: allocating 128 times
+// CHECK_MAY_RETURN_0: Some of the malloc calls returned non-null: 128
// CHECK_MAY_RETURN_0: allocating 256 times
-// CHECK_MAY_RETURN_0: Some of the malloc calls returned non-null: 256
-// CHECK_MAY_RETURN_0: allocating 512 times
// CHECK_MAY_RETURN_0: allocator is terminating the process instead of returning
More information about the llvm-commits
mailing list