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

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 10:51:03 PST 2019


kcc added a comment.

In D70738#1772158 <https://reviews.llvm.org/D70738#1772158>, @Manishearth wrote:

> > 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.
>
> This requires parsing the human-readable libfuzzer output though, which could change, and is also brittle


No. libFuzzer writes the input file to a predictable path which is reported in a line like

  artifact_prefix='./'; Test unit written to ./crash-a40d96b9ef9c17f9012c0159faa4efb01b6daf1b

The path is controlled by two flags, exact_artifact_path and artifact_prefix so that you can write the file to a precisely specified path instead.

If you need to automate human-readable dumping of artifacts after the fact 
I would use artifact_prefix=./ARTIFACT_DIR_NAME and then dump all files that appear in ARTIFACT_DIR_NAME.


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