go: Illegal instructions (SSE4) in go1.19+ -race builds (fails on some Intel Atom cores)
What version of Go are you using (go version
)?
go version go1.19rc1 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
linux/amd64
What did you do?
go build -race
generates SSE4 instruction(s) that are executed on non-SSE4 capable CPUs (old Intel Atom).
(pinsrq
specifically)
go1.18 works as expected
What did you expect to see?
program should run
What did you see instead?
crash, no output, fails in early runtime:
$ ./program
Illegal instruction
using gdb:
Program received signal SIGILL, Illegal instruction.
0x0000000000431737 in __sanitizer::SizeClassAllocator32LocalCache<__sanitizer::SizeClassAllocator32<__sanitizer::AP32> >::Refill(
__sanitizer::SizeClassAllocator32LocalCache<__sanitizer::SizeClassAllocator32<__sanitizer::AP32> >::PerClass*, __sanitizer::SizeC
lassAllocator32<__sanitizer::AP32>*, unsigned long) ()
…
0x0000000000431726 <+406>: movdqa %xmm1,%xmm0
0x000000000043172a <+410>: mov $0x14,%edx
0x000000000043172f <+415>: shl $0x4,%rax
0x0000000000431733 <+419>: shl $0xa,%rdi
=> 0x0000000000431737 <+423>: pinsrq $0x1,%rax,%xmm0
0x000000000043173e <+430>: mov %rsi,%rax
0x0000000000431741 <+433>: add $0x1,%rsi
0x0000000000431745 <+437>: movups %xmm0,0x8(%rbx,%rdi,1)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (13 by maintainers)
Commits related to this issue
- tsan: update Go x86 build rules to back off to sse3 This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as ... — committed to llvm/llvm-project by thanm 2 years ago
- cmd/compile: improve GOAMD64=v1 violation test Add more opcodes that are only available in >v1 modes. This test will now correctly detect the regression in -race mode for #53743. Change-Id: Icfbb13... — committed to golang/go by randall77 2 years ago
- runtime/race: update amd64 syso images to avoid sse4 Rebuild selected amd64 syso images with updated LLVM build rules that avoid the use of SSE4, so as to ensure that the Go race detector continues t... — committed to jproberts/go by thanm 2 years ago
- cmd/compile: improve GOAMD64=v1 violation test Add more opcodes that are only available in >v1 modes. This test will now correctly detect the regression in -race mode for #53743. Change-Id: Icfbb13... — committed to jproberts/go by randall77 2 years ago
- tsan: update Go x86 build rules to back off to sse3 This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as ... — committed to draperlaboratory/hope-llvm-project by thanm 2 years ago
- runtime/race: add GOAMD64=v3 version of linux race .syso Makes -race mode faster, in the 15% speedup range. Update #53743 Change-Id: I735eb71902b41c924c9f885ded8f7a350a56b751 Reviewed-on: https://g... — committed to golang/go by randall77 2 years ago
- runtime/race: add GOAMD64=v3 version of linux race .syso Makes -race mode faster, in the 15% speedup range. Update #53743 Change-Id: I735eb71902b41c924c9f885ded8f7a350a56b751 Reviewed-on: https://g... — committed to TroutSoftware/go by randall77 2 years ago
- tsan: update Go x86 build rules to back off to sse3 This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as ... — committed to CTSRD-CHERI/compiler-rt by thanm 2 years ago
I’m ok with a ~15% slowdown, to keep
-race
working on older processors. We can come up with GOAMD64 versioning scheme for 1.20.