[PATCH] D70738: [libFuzzer] Add custom output function

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 18:26:08 PST 2019


kcc added a reviewer: vitalybuka.
kcc added a comment.

[sorry for delay, I was OOO]
So, this patch will cause LLVMFuzzerCustomOutput to be called on the reproducer input
which in turn will cause an arbitrarily large input to be printed to stderr (stdin)?
Or in fact, it will cause an arbitrary action to be performed with {Data,Size}

I can totally see how this is helpful in some cases when running libFuzzer manually, but it can also be very annoying when the reproducer is large. 
In any kind of automated scenario, it should be easy to add a separate binary that prints the inputs in human readable form.

I am still not convinced that this functionality deserves an extension to public API. 
Not because I don't understand the need, but because the public API is expensive to maintain when it gets large.

But if I were convinced, I would ask to change it to

  size_t LLVMFuzzerHumanReadableDump(const uint8_t *Data, size_t Size, uint8_t *Output, size_t MaxOutputSize)

(with a better name and with a description of what happens if the output is > MaxOutputSize )

And then there will need to be a run-time flag (generalized from kMaxUnitSizeToPrint)
to set the maximal size of printed output.

When fuzzing with text protos we don't need this because text protos are human readable.
But we also sometimes fuzz with binary protos. 
Vitaly, WDYT, would the binary proto fuzzing users want to have textual dumps of the reproducers?


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70738/new/

https://reviews.llvm.org/D70738





More information about the llvm-commits mailing list