json

package module
v0.0.0-...-508a3f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

simdjson-fuzz

Fuzzers and corpus for github.com/minio/simdjson-go

Running

go get -u github.com/minio/simdjson-fuzz
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build

Go to $GOPATH$/src/github.com/minio/simdjson-fuzz

Crash testing, execute:

go-fuzz-build -o=fuzz-build.zip -func=Fuzz .
go-fuzz -bin=fuzz-build.zip -workdir=corpus

Correctness testing, execute:

go-fuzz-build -o=fuzz-build.zip -func=FuzzCorrect .
go-fuzz -bin=fuzz-build.zip -workdir=corpus

This package does on purpose not use modules.

Feel free to submit additional corpus as Pull Requests.

Timeouts

Due to problems with the current Go fuzzer better results can often be obtained by running the fuzzer for a shorter time period and restarting it.

A Go program is supplied to do that will run the supplied command for a specific duration.

A continuously looping script can be created in bash for instance:

go-fuzz-build -o=fuzz-build.zip -func=FuzzCorrect .
while true; do
    go run timeout.go -duration=10m go-fuzz -bin=fuzz-build.zip -workdir=corpus
done

In the example the fuzzer runs for 10 minutes before exiting.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fuzz

func Fuzz(data []byte) (score int)

func FuzzCorrect

func FuzzCorrect(data []byte) (score int)

FuzzCorrect will check for correctness and compare output to stdlib.

func FuzzSerialize

func FuzzSerialize(data []byte) (score int)

FuzzCorrect will check for correctness and compare output to stdlib.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL