GithubHelp home page GithubHelp logo

go114-fuzz-build's Introduction

Intro

go114-fuzz-build is a mostly-drop-in replacement for go-fuzz-build's -libfuzzer build mode, but uses cmd/compile's native libfuzzer instrumentation (included experimentally since Go 1.14) instead of source-to-source transformation.

Example

  1. Install go114-fuzz-build:
$ go get -u github.com/mdempsky/go114-fuzz-build
  1. Build Kubernetes fuzz target with go114-fuzz-build and link against libFuzzer:
$ git clone --depth=1 git clone --depth 1 https://github.com/kubernetes/kubernetes.git
$ cd kubernetes
$ go114-fuzz-build -o yaml_FuzzSigYaml.a -func FuzzSigYaml ./test/fuzz/yaml
$ clang -o yaml_FuzzSigYaml yaml_FuzzSigYaml.a -fsanitize=fuzzer

go114-fuzz-build's People

Contributors

mdempsky avatar pventuzelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go114-fuzz-build's Issues

Cannot find package error

Hi,

Not having much luck getting this to work on go1.14.4 unfortunately.

Repro Steps:

  1. go get -u github.com/mdempsky/go114-fuzz-build
  2. git clone --depth 1 https://github.com/kubernetes/kubernetes.git
  3. cd kubernetes
  4. go114-fuzz-build -o yaml_FuzzSigYaml.a -func FuzzSigYaml ./test/fuzz/yaml

Step 4 is failing with:

test/fuzz/yaml/yaml.go:26:2: cannot find package
test/fuzz/yaml/yaml.go:27:2: cannot find package
test/fuzz/yaml/yaml.go:28:2: cannot find package
2020/07/05 17:43:16 failed to build packages:exit status 1

I also attempted to build the json test too with:

go114-fuzz-build -o json_FuzzStrictDecode.a -func FuzzStrictDecode ./test/fuzz/json

and got a similar error:

test/fuzz/json/json.go:24:2: cannot find package
test/fuzz/json/json.go:25:2: cannot find package
test/fuzz/json/json.go:26:2: cannot find package
2020/07/05 18:31:24 failed to build packages:exit status 1
alex@server:ü/kubernetes$ go version
go version go1.14.4 linux/amd64

alex@server:ü/kubernetes$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/alex/.cache/go-build"
GOENV="/home/alex/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/alex/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/alex/kubernetes/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build330694216=/tmp/go-build -gno-record-gcc-switches"

Add license

Hello,
Could you please add a license here?

I'm currently working on a project that could potentially use a modified version of this or code inspired by this.
I understand it has quite a similar interface to dvuykov's go-fuzz-build but would like to play it careful 😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.