-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
testing: cover profile indicates zero coverage of function under test #48178
Comments
cc @golang/fuzzing |
Unfortunately there's not a straightforward fix for this. We're going to need to figure out a better UX for this. When fuzzing is enabled, there's a coordinator process (spawned by There are a couple options here.
|
Marking as release-blocker. We could do (3) temporarily if that's all we have time for, then implement (1) later. |
For now, we are going to disable |
Checking in on this issue as it's labeled a release blocker for Go 1.18. Is this still a release blocker? |
@thanm , this may be of interest to the coverage improvements you're working on. |
Thanks Austin. I'll add this to my list. |
Q: would there also be potential issues when combining -fuzz with things like "-cpuprofile=..." ? |
Probably yes... all the worker processes may end up writing to the same file. We should look for flags like that and either have workers write to separate files and combine at the end, or disallow them altogether. |
Ping again from the release meeting -- is this a release blocker? |
Yes. At minimum we should disallow any instrumentation that writes to a file while fuzzing. |
cc @katiehockman Friendly ping that this is a release-blocking issue for Go 1.18. |
Change https://golang.org/cl/360395 mentions this issue: |
Given that the |
Supporting this (combination of fuzzing and coverage profiling) will require some non-trivial implementation work. I'd suggest that we track this on a separate issue, as opposed to this one. |
Please also consider disabling similar options combination for built binary... turns out it's possible to misleadingly build and run with coverprofile, but then it also gives 0% coverage:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
n/a
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have two files
I run the beta fuzzer with coverage enabled
Note that the
cover.out
indicates zero coverage of the functionmagic
, which can't be correct as the fuzzer just visited it before the panic.If I run the test again, with coverage going to
cover2.out
, the previous crasher is read from./testdata
and used immediately in the corpus based test stage and I seeSummary: run the fuzzer once to find a crasher, you get no coverage. Start the fuzzer again, you get coverage for the run using the crasher.
What did you expect to see?
I expected to see correct coverage information.
What did you see instead?
I saw zero counts on all the provided coverage points.
The text was updated successfully, but these errors were encountered: