dvyukov/go-fuzz

png fuzzing example does not work

kaoukabiSara opened this issue · 4 comments

I am a new user of @dvyukov go-fuzz tool. I tried to run the png fuzz example as described in https://github.com/dvyukov/go-fuzz and here's what I got :

$ kaoukabi_sara@kaoukabi-sara-UX410UAR:~/go/src/github.com/dvyukov/go-fuzz-corpus/png$ go-fuzz-build
could not load packages: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags gofuzz -- . github.com/dvyukov/go-fuzz/go-fuzz-dep]: exit status 1: go build errors: failed to cache compiled Go files
go build internal/race: failed to cache compiled Go files
go build math/bits: failed to cache compiled Go files
go build github.com/dvyukov/go-fuzz/go-fuzz-defs: failed to cache compiled Go files
go build unicode/utf8: failed to cache compiled Go files
go build runtime/internal/sys: failed to cache compiled Go files
go build image/color: failed to cache compiled Go files
go build internal/cpu: failed to cache compiled Go files
go build unicode: failed to cache compiled Go files
go build sync/atomic: failed to cache compiled Go files
go build runtime/internal/atomic: failed to cache compiled Go files

My go version and go env are:

go version go1.12.9 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kaoukabi_sara/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/kaoukabi_sara/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"                                                                                                                                                              
GOTMPDIR=""                                                                                                                                                                         
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"                                                                                                                                      
GCCGO="gccgo"                                                                                                                                                                       
CC="gcc"                                                                                                                                                                            
CXX="g++"                                                                                                                                                                           
CGO_ENABLED="1"                                                                                                                                                                     
GOMOD=""                                                                                                                                                                            
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-build528825047=/tmp/go-build -gno-record-gcc-switches"

Any suggestion ?

Hmm. Looks like something is wrong with the go command’s cache. Does go clean -cache help? Is the cache directory writeable?

@josharian I just tried it and I got this :

kaoukabi_sara@kaoukabi-sara-UX410UAR:~/go/src/github.com/dvyukov/go-fuzz-corpus/png$ sudo go clean -cache
sudo: go: command not found

pretty wierd ?!

@josharian I finally cleaned the cache thanks to your command. go was indeed installed and set in PATH but not in the secure_path for sudo (but when I run $ sudo visudo I can see that the go path is set there...weird). So I finally run $ sudo /usr/local/go/bin/go clean -cache -modcache -i -r. The thing is I can't see any crashers :

2019/09/03 03:31:05 workers: 8, corpus: 266 (3s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 3s
2019/09/03 03:31:08 workers: 8, corpus: 266 (6s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 1645, uptime: 6s
2019/09/03 03:31:11 workers: 8, corpus: 266 (9s ago), crashers: 0, restarts: 1/7681, execs: 115219 (12757/sec), cover: 1645, uptime: 9s
2019/09/03 03:31:14 workers: 8, corpus: 266 (12s ago), crashers: 0, restarts: 1/8425, execs: 227478 (18906/sec), cover: 1645, uptime: 12s
2019/09/03 03:31:17 workers: 8, corpus: 266 (15s ago), crashers: 0, restarts: 1/9149, execs: 311090 (20695/sec), cover: 1645, uptime: 15s
2019/09/03 03:31:20 workers: 8, corpus: 266 (18s ago), crashers: 0, restarts: 1/8873, execs: 390433 (21652/sec), cover: 1645, uptime: 18s
2019/09/03 03:31:23 workers: 8, corpus: 266 (21s ago), crashers: 0, restarts: 1/9305, execs: 465285 (22123/sec), cover: 1645, uptime: 21s
2019/09/03 03:31:26 workers: 8, corpus: 266 (24s ago), crashers: 0, restarts: 1/9463, execs: 529982 (22053/sec), cover: 1645, uptime: 24s
2019/09/03 03:31:29 workers: 8, corpus: 266 (27s ago), crashers: 0, restarts: 1/9596, execs: 585415 (21656/sec), cover: 1645, uptime: 27s
2019/09/03 03:31:32 workers: 8, corpus: 266 (30s ago), crashers: 0, restarts: 1/9403, execs: 639468 (21293/sec), cover: 1645, uptime: 30s
2019/09/03 03:31:35 workers: 8, corpus: 266 (33s ago), crashers: 0, restarts: 1/9461, execs: 690695 (20910/sec), cover: 1645, uptime: 33s
2019/09/03 03:31:38 workers: 8, corpus: 266 (36s ago), crashers: 0, restarts: 1/9563, execs: 745950 (20702/sec), cover: 1645, uptime: 36s
2019/09/03 03:31:41 workers: 8, corpus: 266 (39s ago), crashers: 0, restarts: 1/9523, execs: 819029 (20983/sec), cover: 1645, uptime: 39s
2019/09/03 03:31:44 workers: 8, corpus: 266 (42s ago), crashers: 0, restarts: 1/9490, execs: 892063 (21223/sec), cover: 1645, uptime: 42s
2019/09/03 03:31:47 workers: 8, corpus: 266 (45s ago), crashers: 0, restarts: 1/9550, execs: 964579 (21420/sec), cover: 1645, uptime: 45s
2019/09/03 03:31:50 workers: 8, corpus: 266 (48s ago), crashers: 0, restarts: 1/9597, execs: 1036504 (21579/sec), cover: 1645, uptime: 48s
2019/09/03 03:31:53 workers: 8, corpus: 266 (51s ago), crashers: 0, restarts: 1/9640, execs: 1108711 (21726/sec), cover: 1645, uptime: 51s
2019/09/03 03:31:56 workers: 8, corpus: 266 (54s ago), crashers: 0, restarts: 1/9601, execs: 1181035 (21858/sec), cover: 1645, uptime: 54s

Any explanation ?

Any explanation ?

The png library you are testing does not contain any bugs that this fuzzer can find in 54 seconds.
It may find something later. Or maybe not.