pprof/fuzz
Alexey Alexandrov 1763105d91
Go 1.19 released, so update supported Go versions. (#721)
* Go 1.19 released, so update supported Go versions.

* Remove the usage of the deprecated ioutil package.
2022-08-18 08:03:47 -07:00
..
corpus Add some proto files to the initial fuzz corpus. (#247) 2017-10-27 09:43:37 -07:00
testdata Added files to enable fuzz testing and fixed bug found with fuzzing (#150) 2017-07-10 11:19:25 -07:00
README.md Added files to enable fuzz testing and fixed bug found with fuzzing (#150) 2017-07-10 11:19:25 -07:00
fuzz_test.go Go 1.19 released, so update supported Go versions. (#721) 2022-08-18 08:03:47 -07:00
main.go add missing license headers (#437) 2018-11-14 11:26:27 -08:00

README.md

This is an explanation of how to do fuzzing of ParseData. This uses github.com/dvyukov/go-fuzz/ for fuzzing.

How to use

First, get go-fuzz

$ go get github.com/dvyukov/go-fuzz/go-fuzz
$ go get github.com/dvyukov/go-fuzz/go-fuzz-build

Build the test program by calling the following command (assuming you have files for pprof located in github.com/google/pprof within go's src folder)

$ go-fuzz-build github.com/google/pprof/fuzz

The above command will produce pprof-fuzz.zip

Now you can run the fuzzer by calling

$ go-fuzz -bin=./pprof-fuzz.zip -workdir=fuzz

This will save a corpus of files used by the fuzzer in ./fuzz/corpus, and all files that caused ParseData to crash in ./fuzz/crashers.

For more details on the usage, see github.com/dvyukov/go-fuzz/

About the to corpus

Right now, fuzz/corpus contains the corpus initially given to the fuzzer

If using the above commands, fuzz/corpus will be used to generate the initial corpus during fuzz testing.

One can add profiles into the corpus by placing these files in the corpus directory (fuzz/corpus) prior to calling go-fuzz-build.