From 59186586caec99148c72cd89be58049644837aaa Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 8 Dec 2023 08:16:41 +0100 Subject: [PATCH 1/2] README: main: switch from go-fuzz to the builtin fuzzer --- README.md | 2 +- main.go | 34 ++++++---------------------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index d793074..1b8e58d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ FuzzyVM creates state tests that can be used to differential fuzz EVM implementa It only focus on the test generation part, the test execution is handled by [goevmlab](https://github.com/holiman/goevmlab). ## Environment -You need to have golang, go-fuzz, go-fuzz-build, and go-ethereum installed +You need to have golang and go-ethereum installed ## Install instructions diff --git a/main.go b/main.go index 62e614a..bfec3db 100644 --- a/main.go +++ b/main.go @@ -56,12 +56,6 @@ var minCorpusCommand = &cli.Command{ Action: minimizeCorpus, } -var buildCommand = &cli.Command{ - Name: "build", - Usage: "Builds the fuzzer", - Action: build, -} - var runCommand = &cli.Command{ Name: "run", Usage: "Runs the fuzzer", @@ -79,7 +73,6 @@ func initApp() *cli.App { benchCommand, corpusCommand, minCorpusCommand, - buildCommand, runCommand, } return app @@ -125,24 +118,6 @@ func corpus(c *cli.Context) error { return nil } -func build(c *cli.Context) error { - cmdName := "go-fuzz-build" - // ignore x/exp/rand, otherwise the build will fail, see also https://github.com/dvyukov/go-fuzz/issues/331 - args := []string{ - "-preserve", - "golang.org/x/exp/rand", - } - cmd := exec.Command(cmdName, args...) - cmd.Dir = "fuzzer" - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - // We have to disable CGO - cgo := "CGO_ENABLED=0" - env := append(os.Environ(), cgo) - cmd.Env = env - return cmd.Run() -} - func run(c *cli.Context) error { directories := []string{ outputRootDir, @@ -158,9 +133,12 @@ func run(c *cli.Context) error { } func startGenerator(genThreads int) *exec.Cmd { - cmdName := "go-fuzz" - dir := "./fuzzer/fuzzer-fuzz.zip" - cmd := exec.Command(cmdName, "--bin", dir, "--procs", fmt.Sprint(genThreads)) + var ( + cmdName = "go" + target = "FuzzVM" + dir = "./fuzzer/..." + ) + cmd := exec.Command(cmdName, "test", "--fuzz", target, "--parallel", fmt.Sprint(genThreads), dir) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Start(); err != nil { From 636750ef2f990df293078389fccd41bd4f001c7a Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 8 Dec 2023 08:17:20 +0100 Subject: [PATCH 2/2] README: main: switch from go-fuzz to the builtin fuzzer --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1b8e58d..9ccb3ad 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ git clone git@github.com:MariusVanDerWijden/FuzzyVM.git cd FuzzyVM # Build the binary go build -# Create the fuzz-test generator as follows: -./FuzzyVM build # Create an initial corpus ./FuzzyVM corpus --count 100 # Run the fuzzer