-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.sh example for go test -fuzz #102
Comments
Ah reading https://google.github.io/clusterfuzzlite/build-integration/#prerequisites it looks like ClusterFuzzLite wants some other kind of fuzz target
|
Perhaps I can follow https://google.github.io/oss-fuzz/getting-started/new-project-guide/go-lang/#native-go-fuzzing-support though ? It mentions compile_native_go_fuzzer |
ClusterFuzzLite definitely supports non-clang targets. I will change this, this is talking about C/C++ code. tl;dr no unless we can fuzz this target with libfuzzer. |
@DavidKorczynski just confirming, oss-fuzz doesn't support go 1.18 fuzzing right? |
tldr: yes it does and I think it should work here. @AdamKorcz can you clarify details here? My personal summary, although Adam knows a lot more about this: OSS-Fuzz supports fuzzing of targets written syntactically for go 1.18 native. These targets, however, are compiled such that they run by way of libFuzzer. A consequence of this is the corpus used for native fuzzing and the OSS-Fuzz style will be incompatible. i.e. you cannot upload your own corpus and reproduction of issues should happen by way of OSS-Fuzz. But besides that, OSS-Fuzz is fully compatible with go 1.18 targets and already larger projects are using it, e.g. Istio (google/oss-fuzz#7992). |
@AdamKorcz could you perhaps make a sample go 1.18 ClusterFuzzLite integration if this would help? |
Go 1.18 fuzz targets can run on OSS-Fuzz using |
This should work. |
And we should be able to do that with all go 1.18 fuzzers as long as they are compiled by way of |
Thanks I now have ClusterFuzzLite running in GitHub Actions hickford/merkle#1 my setup https://github.com/hickford/merkle/blob/main/.clusterfuzzlite/Dockerfile and https://github.com/hickford/merkle/blob/main/.clusterfuzzlite/build.sh However when I tested it by deliberately breaking the test, the workflow succeeded regardless. Any ideas?
Fuzz test fails locally as expected within seconds
|
ClusterFuzzLite is not running the libFuzzer binary here. The fuzzer is being run by way of Your workflow is correctly building the fuzzer with EDIT: Sorry, I thought that the stacktrace you added was from the CI. Please disregard this message and see the one below. |
The fuzzer should find this bug in the CI. Could you try increasing the fuzz time to 30 minutes? |
Okay, I see the issue here. I will get a fix ready for this. |
@hickford This should now have been fixed in https://github.com/AdamKorcz/go-118-fuzz-build. Could you trigger the CI job again and ensure that you are using the latest version of |
@AdamKorcz Thanks, yes working as expected now. hickford/merkle#1 When I try to break the test, the workflow fails. https://github.com/hickford/merkle/actions/runs/2732014085 |
That is great! @jonathanmetzman this issue can be closed. |
I write fuzz tests in Go 1.18 following https://go.dev/doc/fuzz/ and run them with a command such as
go test -fuzz=Range
. How can I integrate them with ClusterFuzzLite?I ran
python3 infra/helper.py generate --external --language=go $PATH_TO_PROJECT
but now I'm stuck. What do I put in build.sh? It would be neat to have an example in the documentation. The current example looks C++ specific https://google.github.io/clusterfuzzlite/build-integration/#buildshThe text was updated successfully, but these errors were encountered: