Skip to content

Illegal instructions (SSE4) in go1.19+ -race builds (fails on some Intel Atom cores) #53743

Closed
@cwedgwood

Description

@cwedgwood

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions