internal/fuzzing, cmd/go: compiling fuzz-tests do not include coverage instrumentation #73465
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go1.24.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I want to build a fuzztest as a standalone binary, for usage in a docker container. However,
the binary complains that "the test binary was not built with coverage instrumentation, so fuzzing will run without coverage guidance and may be inefficient".
I want to enable the coverage instrumentation. Repro steps, below.
Example test:
Running it regularly works fine:
Compiling it yields complaint:
If I try to use the
-cover
when compiling, it does not help:However, if I add
-coverpkg
, then something happens. (This is a bit odd, because without specifyingcoverpkg
, it should target all packages):It still complains about lack of coverage instrumentation, but it also emits coverage data afterwards...
Also, if I specify a too large
-coverpkg
expression, it leads to some internal crash:What did you see happen?
Standalone fuzzing-binaries are less efficient than fuzz-tests executed via
go test
.What did you expect to see?
I'd like to be able to compile fuzz-tests as standalone binaries, to execute in docker-containers which do not have the go runtime.
The text was updated successfully, but these errors were encountered: