Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- docker run -it gcr.io/fuzzit-public/buster-golang12:2dc7875 /bin/bash
- # Download this example
- go get github.com/fuzzitdev/example-go
- cd /go/src/github.com/fuzzitdev/example-go
- # building instrumented version of the code together with libFuzzer integration
- go-fuzz-build -libfuzzer -o parse-complex.a .
- clang -fsanitize=fuzzer parse-complex.a -o parse-complex
- ./parse-complex
- # The output will be as follows:
- ##1293550 NEW ft: 10 corp: 6/26b lim: 4096 exec/s: 76091 rss: 25Mb L: 5/5 MS: 1 CopyPart-
- #panic: runtime error: index out of range
- #
- #goroutine 17 [running, locked to thread]:
- #github.com/fuzzitdev/example-go/pkg/parser.ParseComplex.func5(...)
- # /go/src/github.com/fuzzitdev/example-go/pkg/parser/parse_complex.go:5
- #github.com/fuzzitdev/example-go/pkg/parser.ParseComplex(0x2aabb20, 0x5, 0x5, 0xc00001e040)
- # /go/src/github.com/fuzzitdev/example-go/pkg/parser/parse_complex.go:5 +0x1b2
- #github.com/fuzzitdev/example-go/pkg/parser.Fuzz(...)
- # /go/src/github.com/fuzzitdev/example-go/pkg/parser/parse_complex_fuzz.go:6
- #main.LLVMFuzzerTestOneInput(0x2aabb20, 0x5, 0x545b78)
- # /tmp/go-fuzz-build316206684/gopath/src/github.com/fuzzitdev/example-go/pkg/parser/go.fuzz.main/main.go:35 +0x84
- #main._cgoexpwrap_90699947e885_LLVMFuzzerTestOneInput(0x2aabb20, 0x5, 0x2aaab10)
- # _cgo_gotypes.go:64 +0x37
- #==4262== ERROR: libFuzzer: deadly signal
- # #0 0x45c110 in __sanitizer_print_stack_trace (/go/src/github.com/fuzzitdev/example-go/parser-fuzz.libfuzzer+0x45c110)
- # #1 0x43b79b in fuzzer::PrintStackTrace() (/go/src/github.com/fuzzitdev/example-go/parser-fuzz.libfuzzer+0x43b79b)
- # #2 0x422123 in fuzzer::Fuzzer::CrashCallback() (/go/src/github.com/fuzzitdev/example-go/parser-fuzz.libfuzzer+0x422123)
- # #3 0x7f0ba60ff72f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1272f)
- # #4 0x4acc70 in runtime.raise /tmp/go-fuzz-build316206684/goroot/src/runtime/sys_linux_amd64.s:149
- #
- #NOTE: libFuzzer has rudimentary signal handlers.
- # Combine libFuzzer with AddressSanitizer or similar for better crash reports.
- #SUMMARY: libFuzzer: deadly signal
- #MS: 1 ChangeByte-; base unit: 89b92cdd9bcb9b861c47c0179eff7b3a9baafcde
- #0x46,0x55,0x5a,0x5a,0x49,
- #FUZZI
- #artifact_prefix='./'; Test unit written to ./crash-df779ced6b712c5fca247e465de2de474d1d23b9
- #Base64: RlVaWkk=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement