Fixes: #72766
Change-Id: I45b521e53c2a11e259dc99e2dfc8e40cac39139a
Reviewed-on: https://go-review.googlesource.com/c/go/+/673575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
if bytes.Contains(out, []byte("AddressSanitizer")) {
t.Error(`output contains "AddressSanitizer", but should not`)
}
+ if !bytes.Contains(out, []byte("FUZZ FAILED")) {
+ t.Error(`fuzz test did not fail with a "FUZZ FAILED" sentinel error`)
+ }
}
func mustHaveASAN(t *testing.T) *config {
r1 := Reverse(s)
r2 := Reverse(r1)
if s != r2 {
- t.Errorf("got %q want %q", r2, s)
+ t.Errorf("FUZZ FAILED: got %q want %q", r2, s)
}
})
}
return false
}
+ // Do not instrument counter globals in internal/fuzz. These globals are replaced by the linker.
+ // See go.dev/issue/72766 for more details.
+ if n.Sym().Pkg.Path == "internal/fuzz" && (n.Sym().Name == "_counters" || n.Sym().Name == "_ecounters") {
+ return false
+ }
+
// Do not instrument globals that are linknamed, because their home package will do the work.
if n.Sym().Linkname != "" {
return false