Skip to content
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

runtime: traceback: unexpected SPWRITE function msancall/asancall #65841

Open
mauri870 opened this issue Feb 21, 2024 · 5 comments
Open

runtime: traceback: unexpected SPWRITE function msancall/asancall #65841

mauri870 opened this issue Feb 21, 2024 · 5 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mauri870
Copy link
Member

mauri870 commented Feb 21, 2024

Go version

1.21, 1.22, gotip

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN='/home/mauri870/gopath/bin'
GOCACHE='/home/mauri870/.cache/go-build'
GOENV='/home/mauri870/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/mauri870/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/mauri870/gopath'
GOPRIVATE=''
GOPROXY='direct'
GOROOT='/home/mauri870/git/go'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/mauri870/git/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.23-1a8ee033f8 Tue Feb 20 22:55:07 2024 +0000'
GCCGO='/usr/bin/gccgo'
GOAMD64='v1'
AR='ar'
CC='clang-17'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build273665276=/tmp/go-build -gno-record-gcc-switches'

What did you do?

export CC=clang
go test -run ^TestDebugCallGC$ runtime -v -asan -count 10
go test -run ^TestDebugCallGC$ runtime -v -msan -count 10

What did you see happen?

Crash when running runtime tests with -asan or -msan.

traceback: unexpected SPWRITE function msancall
fatal error: traceback                                                                               

What did you expect to see?

Either src/runtime/debug_test.go tests to pass, or skip these with && linux && !race && !msan && !asan)

@mauri870 mauri870 added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Feb 21, 2024
@mauri870
Copy link
Member Author

I just confirmed the same issue happens with -race, if the !race tag is removed from src/runtime/debug_test.go.

So the solution is pretty simple, add !msan and !asan to this file.

@mauri870 mauri870 added help wanted NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 21, 2024
@gopherbot
Copy link

Change https://go.dev/cl/565735 mentions this issue: runtime: fix unexpected SPWRITE func msan/asancall

@prattmic
Copy link
Member

@mknyszek do you know if debugcall is intended to work with msan/asan enabled?

@mauri870
Copy link
Member Author

mauri870 commented Feb 26, 2024

There is a comment in debug_test.go that says:

// We skip all of these tests under race mode because our test thread
// spends all of its time in the race runtime, which isn't a safe
// point.

It says nothing about race being unsupported. Maybe due to the lack of tests (since this one is skipped) it stopped working at some point? Either way, both race, asan and msan make this test panic with the same SPWRITE error.

I'm also curious about the actual race support for debug call.

EDIT: Sometimes the test freeze with debug_test.go:211: executing on Go runtime stack. Looks like there is some flakyness to the error as well.

@mknyszek
Copy link
Contributor

The debug call tests do some really weird things. I'm not really sure anyone who worked on that code thought about msan/asan when writing those tests, so I wouldn't be surprised if there are issues lurking there.

@mknyszek mknyszek added this to the Backlog milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

4 participants