Go version
go version devel go1.23-82c371a307 Fri Jun 28 19:59:35 2024 +0000 linux/amd64
Output of go env
in your module/workspace:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/goroot'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/goroot/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.23-82c371a307 Fri Jun 28 19:59:35 2024 +0000'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
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 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1955169089=/tmp/go-build -gno-record-gcc-switches'
What did you do?
On a Sun workstation with an AMD Opteron(tm) 144 Processor running Debian, 1. Bootstrap the go compiler & toolchain (1.4, 1.17.13, 1.20.6) using build.bash 2. For the master branch, run all.bash
What did you see happen?
./all.bash | tee ~/build-output
build-output
##### Testing race detector
signal: illegal instruction
FAIL runtime/race 0.020s
FAIL
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
##### ../test
skipped due to earlier error
What did you expect to see?
Inspired by issue #63872 , I've been trying to see if GOAMD64=v1 actually runs on baseline v1 hardware. I'm not necessarily arguing that the race detector needs to run on the oldest amd64 processor I can get my hands on, but if amd64 has a baseline set of required processor features, we should document it.
Comment From: gabyhelp
Related Issues
- runtime: race detector on ARM64 doesn't fully work #28848 (closed)
- runtime: add race detector for ios/arm64 #39521
- cmd/compile: race is not supported on windows/386 #57543 (closed)
- cmd/go: help message of race detector is not consistent with golang.org/doc #49173 (closed)
- runtime/race: race_linux_amd64.syso now depends on glibc 2.17 #53522 (closed)
- runtime: Add error message when running non GOAMD64=v1 on unsupported hardware #48506 (closed)
- race: 'unsupported VMA range' on linux/arm64 #29948 (closed)
- runtime: crash in race detector when execution tracer reads from CPU profile buffer #65607 (closed)
- cmd/compile: race is not supported on linux/riscv64 #58739 (closed)
- runtime: dependency on AVX instruction set added in Go 1.14 on macOS #37477 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: randall77
The race detector should run on v1 hardware. We even have a separate build of the race detector for that target (src/runtime/race/internal/amd64v1/*.syso
).
It would be interesting to see what the bad instruction is. Try building a hello world program with the race detector and run it under a debugger.
(It probably isn't an instruction on the Go side, as we print more information when an illegal instruction trap happens while executing Go code.)
Does this same error happen for 1.22?
Comment From: 9072997
I am now running 1.22 downloaded from go.dev.
root@sun:~# go version
go version go1.22.4 linux/amd64
root@sun:~# go build -race hello.go
root@sun:~# gdb hello
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello...
Loading Go Runtime support.
(gdb) run
Starting program: /root/hello
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGILL, Illegal instruction.
0x0000000000410af1 in __tsan::Context::Context() ()
(gdb) layout asm
Comment From: randall77
movddup
is sse3, sure enough. Looks like we might have to rebuild the v1 syso. Not sure how that build failed to avoid disallowed instructions, but we'll look into it.
Comment From: thanm
@golang/runtime
Comment From: randall77
Unfortunately, I think I have to take that back. Our race detector has never worked without sse3. At least, I see that sse3 was enabled around 2014. (https://github.com/llvm/llvm-project commit 8744b1c1e3be0c7136c38fc9bc4d055aa58e105a) See #53743 So I don't think there is any coding to do here. Probably a doc update to list the higher requirement for the race detector is all we are going to be able to do.
Comment From: gopherbot
Change https://go.dev/cl/595976 mentions this issue: mention higher arch requirement for amd64 race detector