-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
compile_native_go_fuzzer: only search for fuzz function in .go files #7903
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Thanks a lot for this. Is there any chance you could also get rid of the |
Sure, is there any particular reason that was left as a TODO - anything to look out for here? |
Not really. There shouldn't be anything contextual in OSS-Fuzz that caused the |
@kmoe friendly ping :) |
ca6e880
to
32e52b2
Compare
The first commit was superseded by #8238, so I've rebased. Also removed the redundant grep @AdamKorcz @Navidem, thanks for your patience. This is ready for review. |
/gcbrun trial_build.py go --engine libfuzzer --sanitizer coverage address |
Are we still interested in merging this? |
Found this issue while updating HCL fuzzer to Go 1.18 native fuzzing.
Issue
Prior to this change,
$fuzzer_filename
is populated with a list of all files containing the fuzz$function
string, whether they be git index file, README, Go file, or anything else.These multiple files are passed to
rewrite_go_fuzz_harness
on line 86 as separate arguments:This leads to an error on line 31 as the arguments to
rewrite_go_fuzz_harness
are now incorrect.Solution
Limiting the grep to
.go
files (a47f2e0) fixes the case in which the fuzz$function
string is present in one Go file and one or more non-Go files.Subsequent lines of the script will still break if
$function
is present in more than one Go file. ca6e880 suggests erroring out in this case.