-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fuzz: link libfuzzer engine to fuzz with bazel! #7805
Conversation
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
/retest |
🔨 rebuilding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super awesome, nice to see that it's relatively few lines of code and not too much hackery.
Can you update https://github.com/envoyproxy/envoy/blob/master/test/fuzz/README.md with a section on how to run this on CLI. I think the best guidance is to tell folks to do something like:
bazel run //test/common/common:base64_fuzz_test_driver --config asan-fuzzer
/wait
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
/retest |
🔨 rebuilding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is huge improvement to fuzzing development productivity, LGTM. I like the ability to work directly with corpus.
@yevgenypats this is probably the right basis for doing fuzzing outside of oss-fuzz when working directly under CI.
This is awesome, I'll rebase my PR on top of this one, once it is merged!. |
/retest |
🔨 rebuilding |
looks like one of tests here fails. maybe it's out of memory? |
Can you try applying this? I think it will fix clang_tidy:
Also merge master to pick up CI changes. |
…utefuzz Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
This is still gets killed due to oom. I suspect that you need to add |
Signed-off-by: Asra Ali <[email protected]>
Thank you! Yes, let's see. I'm not sure what the implications are later, but I did add the jobs flag to see what happens. |
horray! it worked:) #why_bazel_spins_up_200_workers_by_default:) |
Can you try to fix the jobs number to env ${NUM_CPUS} (which is set to 8 in CI)? @yevgenypats bazel automatically spins up job to the number of CPU cores, which ignores cgroup, so in a docker environment in large host, it spins job more than cgroup restriction. |
Signed-off-by: Asra Ali <[email protected]>
Thanks everyone. clang-tidy runs with NUM_CPUS jobs now. |
horray! lets merge! |
This makes a new config "asan-fuzzer" that links to the libfuzzer engine.
To run a fuzz target with asan and libfuzzer, do
bazel build --config=asan-fuzzer test/common/router:route_fuzz_test_with_libfuzzer --config=asan-fuzzer
bazel-bin/test/common/router/route_fuzz_test_driver test/common/router/route_corpus -runs=-1
(-runs=-1 for indefinite runs, -runs=100 for bounded).
Testing: works locally
Risk: Low