[PATCH] D45693: [LibFuzzer] Tweak `MutationDispatcher::Mutate_CopyPart` mutation.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 01:44:25 PDT 2018


delcypher added a comment.

In https://reviews.llvm.org/D45693#1069081, @kcc wrote:

> LGTM
>  I wonder how you can observe the change? 
>  It's just a slight change in probabilities. 
>  Or not slight?


To give some context, this patch is actually part of a larger change made to JFS's copy of LibFuzzer. For JFS, inputs never change size, so it's a waste of time to perform mutations that change the input size.
To fix this in JFS we added a command line option to disable all mutations that change the input size. I don't think our approach is general enough to be upstreamed. However the change in this patch
seemed general enough to be upstreamed. At some point I plan to start a discussion on how to fix JFS's problem in a more general way on the LibFuzzer mailing list. I just haven't got around to posting yet.

> I prefer to test similar changes in lib/fuzzer/tests/FuzzerUnittest.cpp 
>  but I don't see how to test this one...

A possible way to test this might be to call `Mutate_CopyPart` directly with a input that is `MaxSize` in size and make sure that it returns `MaxSize` (i.e. input size is not changed).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D45693





More information about the llvm-commits mailing list