[PATCH] D28706: [libFuzzer] Fix Out of Memory tests to work on 32 bits.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 18:10:02 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292744: [libFuzzer] Fix OutOfMemory tests to work on 32 bits. (authored by mpividori).

Changed prior to commit:
  https://reviews.llvm.org/D28706?vs=84392&id=85266#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28706

Files:
  llvm/trunk/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
  llvm/trunk/lib/Fuzzer/test/fuzzer-oom.test


Index: llvm/trunk/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
+++ llvm/trunk/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
@@ -15,7 +15,7 @@
   if (Size > 0 && Data[0] == 'H') {
     if (Size > 1 && Data[1] == 'i') {
       if (Size > 2 && Data[2] == '!') {
-          size_t kSize = 0xff000000U;
+          size_t kSize = 0x20000000U;
           char *p = new char[kSize];
           SinkPtr = p;
           delete [] p;
Index: llvm/trunk/lib/Fuzzer/test/fuzzer-oom.test
===================================================================
--- llvm/trunk/lib/Fuzzer/test/fuzzer-oom.test
+++ llvm/trunk/lib/Fuzzer/test/fuzzer-oom.test
@@ -3,8 +3,8 @@
 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28706.85266.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170122/f9cd62c4/attachment.bin>


More information about the llvm-commits mailing list