summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/fuzzer-oom.test
diff options
context:
space:
mode:
authorMarcos Pividori <mpividori@google.com>2017-01-22 01:58:50 +0000
committerMarcos Pividori <mpividori@google.com>2017-01-22 01:58:50 +0000
commitbbfc8c357c0356db8d3bd4e6d2277248025619ea (patch)
treec1b2c22abbb4777cb280bb5a515e1cfb38e45def /llvm/lib/Fuzzer/test/fuzzer-oom.test
parent61ecfc0be3dd4c51e2c61fa9a0c277c8b42c1131 (diff)
downloadbcm5719-llvm-bbfc8c357c0356db8d3bd4e6d2277248025619ea.tar.gz
bcm5719-llvm-bbfc8c357c0356db8d3bd4e6d2277248025619ea.zip
[libFuzzer] Fix OutOfMemory tests to work on 32 bits.
I add 2 changes to make the tests work on 32 bits and on 64 bits. I change the size allocated to 0x20000000 and add the flag: -rss_limit_mb=300. Otherwise the output for 32 bits and 64 bits is different. For 64 bits the value 0xff000000 doesn't exceed kMaxAllowedMallocSize. For 32 bits, kMaxAllowedMallocSize is set to 0xc0000000, so the call to Allocate() will fail earlier printing "WARNING: AddressSanitizer failed to allocate ..." , and wont't call malloc hooks. So, we need to consider a size smaller than 2GB (so malloc doesn't fail on 32bits) and greater that the value provided by -rss_limit_mb. Because of that I use: 0x20000000. Differential Revision: https://reviews.llvm.org/D28706 llvm-svn: 292744
Diffstat (limited to 'llvm/lib/Fuzzer/test/fuzzer-oom.test')
-rw-r--r--llvm/lib/Fuzzer/test/fuzzer-oom.test4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/test/fuzzer-oom.test b/llvm/lib/Fuzzer/test/fuzzer-oom.test
index 8caf649e9f0..5c3bf78158a 100644
--- a/llvm/lib/Fuzzer/test/fuzzer-oom.test
+++ b/llvm/lib/Fuzzer/test/fuzzer-oom.test
@@ -3,8 +3,8 @@ CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 300Mb)
CHECK: Test unit written to ./oom-
SUMMARY: libFuzzer: out-of-memory
-RUN: not LLVMFuzzer-OutOfMemorySingleLargeMallocTest 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
-SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory (malloc(42{{.*}}))
+RUN: not LLVMFuzzer-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
+SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory (malloc(53{{.*}}))
SINGLE_LARGE_MALLOC: in LLVMFuzzerTestOneInput
# Check that -rss_limit_mb=0 means no limit.
OpenPOWER on IntegriCloud