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
all: go tool dist test -msan
fails many tests
#64256
Comments
This comment was marked as outdated.
This comment was marked as outdated.
go tool dist test -msan
fails many tests
Like #64257, this does not appear to be WSL-specific. |
This CL fixes some warnings when running go tool dist test -msan about an unknown variable "size". Update he variable name to sz to match the function prototypes. For golang#64256
Change https://go.dev/cl/547696 mentions this issue: |
… -msan This test is already marked with !race, but when running the tests with -msan it allocates memory which throws off the test assertions. Marking it !msan as well. For golang#64256
Change https://go.dev/cl/547758 mentions this issue: |
@bcmills Do you know if there is a way to detect if msan is enabled, akin to if n := testing.AllocsPerRun(100, func() { Grow(s2, cap(s2)-len(s2)+1) }); n != 1 {
errorf := t.Errorf
if race.Enabled || testenv.OptimizationOff() {
errorf = t.Logf // this allocates multiple times in race detector mode
}
errorf("Grow should allocate once when given insufficient capacity; allocated %v times", n)
} I can see runtime.msanenabled, but that is private. I wonder if it would be helpful to have an internal/msan and internal/asan similar to internal/race. |
@mauri870, I see a lot of files in the //go:build msan
…
const msanEnabled = true //go:build !msan
…
const msanEnabled = false |
As a short term solution, that would work. It is cumbersome to deal with build flags if a specific part of a specific test needs to be skipped, also the failing tests are not only in runtime, I spotted related failures in at least log/slog and slices. I proposed #64611 to make dealing with these cases more straightforward, similar to how we use |
@mauri870 Just curious, why turning on -msan causes extra allocations? Thanks. |
@zhangfannie It appears to be the same issue we have with -race, Lines 912 to 918 in 2184a39
|
Thank you for the explanation. 🙂 |
Currently go test -msan runtime always fails on loong64, arm64 and amd64. Changed the variable name to sz to match the function prototypes. For #64256 Change-Id: Ida71197307016520deb39293927850d47845140a GitHub-Last-Rev: 0ee1e3b GitHub-Pull-Request: #64572 Reviewed-on: https://go-review.googlesource.com/c/go/+/547696 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Keith Randall <khr@golang.org>
Currently go test -msan runtime always fails on loong64, arm64 and amd64. Changed the variable name to sz to match the function prototypes. For golang#64256 Change-Id: Ida71197307016520deb39293927850d47845140a GitHub-Last-Rev: 0ee1e3b GitHub-Pull-Request: golang#64572 Reviewed-on: https://go-review.googlesource.com/c/go/+/547696 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Keith Randall <khr@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go tool dist test -msan fail
What did you expect to see?
test pass.
What did you see instead?
The text was updated successfully, but these errors were encountered: