Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AdamKorcz opened this issue Apr 12, 2022 · 1 comment
Closed

Comments

@AdamKorcz
Copy link

AdamKorcz commented Apr 12, 2022

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?

@ianlancetaylor
Copy link
Contributor

ianlancetaylor commented Apr 13, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants