go: runtime: GOARM64=v8.1 crash with illegal hardware instruction on v8.6
Go version
go1.24-608acff84
Output of go env in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/sylvain/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/sylvain/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/jq/lq71x93965l422wp3h87r1lr0000gn/T/go-build807651234=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/sylvain/git/nats-server/go.mod'
GOMODCACHE='/Users/sylvain/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/sylvain/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/sylvain/sdk/gotip'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/sylvain/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/sylvain/sdk/gotip/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='devel go1.24-608acff84 Wed Jan 22 10:13:04 2025 -0800'
GOWORK='/Users/sylvain/git/nats-server/go.work'
PKG_CONFIG='pkg-config'
What did you do?
I tried to compile a darmin/arm64 binary and specifying a GOARM64 version my Macbook Air M2 should support.
What did you see happen?
sylvain@tragicomix > ~/git/nats-server > main ± > GOARM64=v8.1 gotip build .
sylvain@tragicomix > ~/git/nats-server > main ± > ./nats-server
[1] 53704 illegal hardware instruction ./nats-server
✘ sylvain@tragicomix > ~/git/nats-server > main ± > lldb ./nats-server
(lldb) target create "./nats-server"
Current executable set to '/Users/sylvain/git/nats-server/nats-server' (arm64).
(lldb) r
Process 53773 launched: '/Users/sylvain/git/nats-server/nats-server' (arm64)
Process 53773 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=1, subcode=0xd5380600)
frame #0: 0x00000001000744d0 nats-server`runtime.rt0_go.abi0 + 176
nats-server`runtime.rt0_go.abi0:
-> 0x1000744d0 <+176>: mrs x0, ID_AA64ISAR0_EL1
0x1000744d4 <+180>: lsr x0, x0, #20
0x1000744d8 <+184>: and x0, x0, #0xf
0x1000744dc <+188>: cbz x0, 0x100074528 ; <+264>
Target 0: (nats-server) stopped.
What did you expect to see?
$ ./nats-server
[52200] 2025/01/23 21:47:40.650150 [INF] Starting nats-server
[52200] 2025/01/23 21:47:40.650302 [INF] Version: 2.11.0-dev
[52200] 2025/01/23 21:47:40.650305 [INF] Git: [257319c]
[52200] 2025/01/23 21:47:40.650308 [INF] Name: NCVSZ2X5FXDLUSYVXB7BTOHAQO4HQ4F54BSZXBR2MNVTPU5CMLNAI5ES
[52200] 2025/01/23 21:47:40.650311 [INF] ID: NCVSZ2X5FXDLUSYVXB7BTOHAQO4HQ4F54BSZXBR2MNVTPU5CMLNAI5ES
[52200] 2025/01/23 21:47:40.652035 [INF] Listening for client connections on 0.0.0.0:4222
[52200] 2025/01/23 21:47:40.652285 [INF] Server is ready
^C[52200] 2025/01/23 21:47:42.070510 [INF] Initiating Shutdown...
[52200] 2025/01/23 21:47:42.070923 [INF] Server Exiting..
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (15 by maintainers)
Commits related to this issue
- Revert "runtime: Check LSE support on ARM64 at runtime init" This reverts CL 610195. Reason for revert: SIGILL on macOS. See issue #71411. Updates #69124, #60905. Fixes #71411. Change-Id: Ie0624e5... — committed to jenningsloy318/go by cherrymui 2 years ago
- runtime: check LSE support on ARM64 at runtime init Check presence of LSE support on ARM64 chip if we targeted it at compile time. Related to #69124 Updates #60905 Fixes #71411 Change-Id: I65e899a2... — committed to golang/go by andreybokhanko 2 years ago
I think we should just revert 610195 and try again next cycle.