[compiler-rt] r330390 - [LibFuzzer] Try to unbreak the `FuzzerMutate.ShuffleBytes1` unit test.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 23:46:14 PDT 2018


Author: delcypher
Date: Thu Apr 19 23:46:14 2018
New Revision: 330390

URL: http://llvm.org/viewvc/llvm-project?rev=330390&view=rev
Log:
[LibFuzzer] Try to unbreak the `FuzzerMutate.ShuffleBytes1` unit test.

This test is failing on my Linux box. Just increasing the number of
iterations works around this. The divergence is likely due to
our reliance on `std::shuffle()` which is not guaranteed to have
the same behaviour across platforms.

This is a strong argument for us to implement our own shuffle
function to avoid divergence in behaviour across platforms.

Differential Revision: https://reviews.llvm.org/D45767

Modified:
    compiler-rt/trunk/lib/fuzzer/tests/FuzzerUnittest.cpp

Modified: compiler-rt/trunk/lib/fuzzer/tests/FuzzerUnittest.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/tests/FuzzerUnittest.cpp?rev=330390&r1=330389&r2=330390&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/tests/FuzzerUnittest.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/tests/FuzzerUnittest.cpp Thu Apr 19 23:46:14 2018
@@ -328,7 +328,7 @@ void TestShuffleBytes(Mutator M, int Num
 }
 
 TEST(FuzzerMutate, ShuffleBytes1) {
-  TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 16);
+  TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 17);
 }
 TEST(FuzzerMutate, ShuffleBytes2) {
   TestShuffleBytes(&MutationDispatcher::Mutate, 1 << 20);




More information about the llvm-commits mailing list