Skip to content

Fuzzing doesn't work (no cgo) #171

Closed
@josselin-c

Description

@josselin-c

Hello, I have a fuzzing job that doesn't run when it should. At first it was because of CGO but now I have CGO disabled and it still doesn't works. I'm not sure how to debug this.

Env

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/joss/projects/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3g/vj270kpd74374rcl0yv9c5dm0000gn/T/go-build339987089=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

Description

Fuzzing this code fails:

package fuzz

import (
	_ "github.com/ethereum/go-ethereum/core"
)

func Fuzz(data []byte) int {
	return 0
}

I'm fuzzing using go-ethereum/core version bfdc0fa3622d7c3b421d2f5a6dda5746be41bfde
I've stubbed the crypto/secp256k1 package as follow: https://gist.github.com/josselin-c/9c66bac044e1489c290c37c43250ff28

I'm building the fuzzing code with cgo disabled: `CGO_ENABLED=0 go-fuzz-build github.com/ethereum/go-ethereum/tests/vmfuzz``

The output:

go-fuzz -bin=./fuzz-fuzz.zip -workdir=results
2017/11/09 08:46:09 slaves: 4, corpus: 1 (3s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 3s
2017/11/09 08:46:12 slaves: 4, corpus: 1 (6s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 6s
2017/11/09 08:46:15 slaves: 4, corpus: 1 (9s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 9s
2017/11/09 08:46:18 slaves: 4, corpus: 1 (12s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 12s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions