-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
common,crypto: move fuzzers out of core #22029
Conversation
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.
LGTM
This PR also needs google/oss-fuzz#4858 to enable code coverage of fuzzed repos. It does quite a few things.
cc @catenacyber |
|
I'm not sure how that would help.. ? It prepends the input tag with Ah, I guess you mean as a way to help it find the sources, if not in |
So, you do not have to move the fuzzers into another directory, just add explicitly the tag as an argument to |
The part about moving the fuzzers is not because of that, it's because If we want them inside the codebase, they should be tagged to not be built "normally". But then And that had some other repercussions, such as having to set the EDIT: Ah, now I get it. Oh, cool! However, we still already have most of them in a separate folder, so it kind of makes sense to have them all there. Plus some fuzzers, e.g. |
Thanks @holiman It seems that we can improve the line in https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/compile_go_fuzzer#L28
Because you have the directory named Maybe |
Otherwise, catenacyber/oss-fuzz@fcfceb9 looks fine Tested with
It works : |
@catenacyber I'm wondering about two things, first of all -- does that version report coverage for all of go-ethereum, or only the specific package being fuzzed? |
I've finally gotten around to checking how that works and what it does :) I think, in general, we're better off just using |
Only the package being fuzzed.
Yes it required a change in oss-fuzz cf catenacyber/oss-fuzz@fcfceb9 @holiman are you good with your changes ? Or do you need something more ? |
We have coverage reporting now, it seems to work fine, so I'm good. If at some point the upstream scripts are changed so |
Ok, I will let you know if |
This is one step towards getting coverage reports, a'la google/oss-fuzz#4847 .
A couple of our fuzzers reside within the go-ethereum core codebase. This is fine, except that in order to not include them in regular builds, they've been tagged with
// +build gofuzz
, to only be included in the fuzzed images.However, the coverage reports are based on runinng regular
go test ...
on a testcase which simply feeds the corpus through theFuzz
function. And theFuzz
function is not visible in that case, since the build-tag is not active when not running viago-fuzz
.So a better approach is to move the fuzzers into
tests/
, and remove the build tag.We still have some other cases where it's more difficult to move them, since the fuzzing relies on un-exported fields (blake2b), but this is a start.