Skip to content

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

@AdamKorcz

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?

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