[all-commits] [llvm/llvm-project] cb8912: [fuzzer] Create user provided fuzzer writeable dir...

Matt Morehouse via All-commits all-commits at lists.llvm.org
Tue Sep 1 11:51:16 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cb8912799d4372a3a1c0bf528bb4c4885caf4c45
      https://github.com/llvm/llvm-project/commit/cb8912799d4372a3a1c0bf528bb4c4885caf4c45
  Author: Matt Morehouse <mascasa at google.com>
  Date:   2020-09-01 (Tue, 01 Sep 2020)

  Changed paths:
    M compiler-rt/lib/fuzzer/FuzzerDriver.cpp
    M compiler-rt/lib/fuzzer/FuzzerFlags.def
    M compiler-rt/lib/fuzzer/FuzzerIO.cpp
    M compiler-rt/lib/fuzzer/FuzzerIO.h
    M compiler-rt/test/fuzzer/fuzzer-dirs.test

  Log Message:
  -----------
  [fuzzer] Create user provided fuzzer writeable directories when requested if they dont exist

Currently, libFuzzer will exit with an error message if a non-existent
directory is provided for any of the appropriate arguments. For cases
where libFuzzer is used in a specialized embedded environment, it would
be much easier to have libFuzzer create the directories for the user.

This patch accommodates for this scenario by allowing the user to provide
the argument `-create_missing_dirs=1` which makes libFuzzer attempt to
create the `artifact_prefix`, `exact_artifact_path`,
`features_dir` and/or corpus directory if they don't already exist rather
than throw an error and exit.

Split off from D84808 as requested [here](https://reviews.llvm.org/D84808#2208546).

Reviewed By: morehouse

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




More information about the All-commits mailing list