Skip to content

testing,internal/fuzz: Running a fuzz executable does not save the corpus? #52292

Closed

Description

@AdamKorcz

When running a fuzzer as an executable, it looks like the corpus generated by the fuzz engine is not saved.

Steps taken to encounter this issue:
Say we have built a binary called fuzz.test. The fuzz harness is called Fuzz.

I run it with ./fuzz.test -test.fuzz=Fuzz.

I get the message:

testing: -test.fuzzcachedir must be set if -test.fuzz is set
...

So I specify the cache dir and run it again:

mkdir /tmp/cachedir
./fuzz.test -test.fuzz=Fuzz -test.fuzzcachedir=/tmp/cachedir

...and after a few minutes I check the contents of the specified cachedir. There are no files.

I then run the fuzzer without building an executable first, and specify the cachedir and check the contents of that cachedir after a few seconds. This time, the corpus is available in /tmp/cachedir/Fuzz. And if I don't specify the cachedir, the corpus files are available in the go-build cachedir.

Is there currently no way to save the corpus when running the fuzzer as an executable?

Activity

  1. ianlancetaylor commented on Apr 13, 2022

    @ianlancetaylor
    Contributor

    We generally do not use the issue tracker for questions. You are more likely to get an answer on a forum; see https://go.dev/wiki/Questions.

    CC @golang/fuzzing

  2. locked and limited conversation to collaborators on Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions