[PATCH] D45767: [LibFuzzer] Try to unbreak the `FuzzerMutate.ShuffleBytes1` unit test

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 05:55:00 PDT 2018


delcypher created this revision.
delcypher added reviewers: kcc, george.karpenkov.
Herald added a subscriber: Sanitizers.

[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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D45767

Files:
  lib/fuzzer/tests/FuzzerUnittest.cpp


Index: lib/fuzzer/tests/FuzzerUnittest.cpp
===================================================================
--- lib/fuzzer/tests/FuzzerUnittest.cpp
+++ lib/fuzzer/tests/FuzzerUnittest.cpp
@@ -328,7 +328,7 @@
 }
 
 TEST(FuzzerMutate, ShuffleBytes1) {
-  TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 16);
+  TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 17);
 }
 TEST(FuzzerMutate, ShuffleBytes2) {
   TestShuffleBytes(&MutationDispatcher::Mutate, 1 << 20);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45767.142920.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180418/08a78aea/attachment.bin>


More information about the llvm-commits mailing list