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

SIGILL: illegal instruction on any go tool under macOS #37459

Closed
carlca opened this issue Feb 26, 2020 · 8 comments
Closed

SIGILL: illegal instruction on any go tool under macOS #37459

carlca opened this issue Feb 26, 2020 · 8 comments

Comments

@carlca
Copy link

carlca commented Feb 26, 2020

What version of Go are you using (go version)?

Theoretically: Go 1.14

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

macOS 10.14.6 Mojave

I cannot run any of the go tools to get any go information.

go env Output
$ go env

What did you do?

I removed the previous version of Golang using sudo rm -rf /usr/local/go, and then installed Go 1.14 - released 25.02.2020.

[1] I then first tried go version.
[2] Followed by go run path.go to a verified location.

What did you expect to see?

[1] I expected to see comforting words confirming that Go 1.14 was indeed installed.
[2] I expected my simple utility app path.go to be recompiled and to run.

What did you see instead?

~/code/go/src/github.com/carlca/utils/path master ❯ go run path.go                                                                                          ✱ ◼
SIGILL: illegal instruction
PC=0x1066040 m=0 sigcode=1

goroutine 1 [running, locked to thread]:
runtime.asyncPreempt()
	/usr/local/go/src/runtime/preempt_amd64.s:8 fp=0xc00005ae60 sp=0xc00005ae58 pc=0x1066040
crypto/rand.init()
	/usr/local/go/src/crypto/rand/util.go:26 fp=0xc00005ae68 sp=0xc00005ae60 pc=0x12055f0
runtime.doInit(0x1a82120)
	/usr/local/go/src/runtime/proc.go:5414 +0x8a fp=0xc00005ae98 sp=0xc00005ae68 pc=0x1043aca
runtime.doInit(0x1a80100)
	/usr/local/go/src/runtime/proc.go:5409 +0x57 fp=0xc00005aec8 sp=0xc00005ae98 pc=0x1043a97
runtime.doInit(0x1a85560)
	/usr/local/go/src/runtime/proc.go:5409 +0x57 fp=0xc00005aef8 sp=0xc00005aec8 pc=0x1043a97
runtime.doInit(0x1a82ae0)
	/usr/local/go/src/runtime/proc.go:5409 +0x57 fp=0xc00005af28 sp=0xc00005aef8 pc=0x1043a97
runtime.doInit(0x1a81fe0)
	/usr/local/go/src/runtime/proc.go:5409 +0x57 fp=0xc00005af58 sp=0xc00005af28 pc=0x1043a97
runtime.doInit(0x1a850c0)
	/usr/local/go/src/runtime/proc.go:5409 +0x57 fp=0xc00005af88 sp=0xc00005af58 pc=0x1043a97
runtime.main()
	/usr/local/go/src/runtime/proc.go:190 +0x1ce fp=0xc00005afe0 sp=0xc00005af88 pc=0x103702e
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00005afe8 sp=0xc00005afe0 pc=0x10647d1

rax    0x1a82120
rbx    0xf
rcx    0x0
rdx    0x1a82198
rdi    0xc000112440
rsi    0x12055f0
rbp    0xc00005ae88
rsp    0xc00005ae58
r8     0x0
r9     0x0
r10    0x171acac
r11    0x1
r12    0xffffffffffffffff
r13    0x45
r14    0x44
r15    0x200
rip    0x1066040
rflags 0x10206
cs     0x2b
fs     0x0
gs     0x0
~/code/go/src/github.com/carlca/utils/path master ❯

The last 15 or so version upgrades to Golang have happened without a hitch. What is different this time?

@carlca carlca changed the title SIGILL: illegal instruction on any go tool under macOS SIGILL: illegal instruction on any go tool under macOS 10.14.6 Feb 26, 2020
@randall77
Copy link
Contributor

Yuck.
I think we broke Darwin/amd64 on pre-AVX chips. VZEROUPPER needs a CPU feature detection guard.

@carlca, could you describe the machine you're running on? Apple menu, "About this Mac", the Processor line would do.

The bug was introduced for #37174, in CL 219131

@cherrymui

@randall77 randall77 added this to the Go1.14.1 milestone Feb 26, 2020
@carlca
Copy link
Author

carlca commented Feb 26, 2020

I suspect you are right. My machine, despite the fact I am running macOS 10.14.6 Mojave, is actually pretty ancient (early 2009), but has been tweaked to within an inch of its life (4,1 > 5,1 firmware patch and dosdude mojave patch).

I ran up against the AVX issue before with some music software (Native Instruments - Massive which would not run on my machine. Luckily I only tried the demo!).

Here are the specs...

Screenshot 2020-02-26 at 01 11 06

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/221057 mentions this issue: runtime: guard VZEROUPPER on CPU feature

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/221058 mentions this issue: [release-branch.go1.14] runtime: guard VZEROUPPER on CPU feature

@dmitshur
Copy link
Contributor

@gopherbot Please open a backport for 1.14. This is a regression in 1.14, and it is a serious problem (program doesn't run on affected hardware) without a workaround.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #37478 (for 1.14).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@randall77 randall77 changed the title SIGILL: illegal instruction on any go tool under macOS 10.14.6 SIGILL: illegal instruction on any go tool under macOS Feb 27, 2020
gopherbot pushed a commit that referenced this issue Mar 2, 2020
In CL 219131 we inserted a VZEROUPPER instruction on darwin/amd64.
The instruction is not available on pre-AVX machines. Guard it
with CPU feature.

Updates #37459.
Fixes #37478.

Change-Id: I9a064df277d091be4ee594eda5c7fd8ee323102b
Reviewed-on: https://go-review.googlesource.com/c/go/+/221057
Run-TryBot: Cherry Zhang <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
(cherry picked from commit c46ffdd)
Reviewed-on: https://go-review.googlesource.com/c/go/+/221058
Run-TryBot: Dmitri Shuralyov <[email protected]>
@pm-harshad-mane
Copy link

I am facing a similar issue on McOS Catalina 10.15.4 on MacBook Pro 2017.

HARSHADMANE-MacBook-Pro:header-bidding harshadmane$ go build
# header-bidding
unexpected fault address 0x2ce40000
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x2ce40000 pc=0x10029ae]

goroutine 1 [running]:
runtime.throw(0x12b62cc, 0x5)
	/usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc001d5e6a0 sp=0xc001d5e670 pc=0x10326c2
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:692 +0x443 fp=0xc001d5e6d0 sp=0xc001d5e6a0 pc=0x1048e63
indexbytebody(0x2ce3fffa, 0x4e, 0x465ef, 0x22, 0xffffffffffffffff, 0xc007cc56c0, 0x20, 0x22220000000007, 0x4e, 0x1551108, ...)
	/usr/local/go/src/internal/bytealg/indexbyte_amd64.s:124 +0xce fp=0xc001d5e6d8 sp=0xc001d5e6d0 pc=0x10029ae
bytes.IndexByte(...)
	/usr/local/go/src/bytes/bytes.go:91
bytes.Index(0x2ce3fffa, 0x50, 0x465ef, 0x1483268, 0x3, 0x3, 0x0)
	/usr/local/go/src/bytes/bytes.go:1022 +0x2a8 fp=0xc001d5e768 sp=0xc001d5e6d8 pc=0x10cd8b8
cmd/link/internal/objfile.(*objReader).readSymName(0xc001d5ebb8, 0x12ba9fe, 0x0)
	/usr/local/go/src/cmd/link/internal/objfile/objfile.go:630 +0x197 fp=0xc001d5e888 sp=0xc001d5e768 pc=0x1152607
cmd/link/internal/objfile.(*objReader).readRef(0xc001d5ebb8)
	/usr/local/go/src/cmd/link/internal/objfile/objfile.go:484 +0x8f fp=0xc001d5e950 sp=0xc001d5e888 pc=0x115194f
cmd/link/internal/objfile.(*objReader).loadObjFile(0xc001d5ebb8)
	/usr/local/go/src/cmd/link/internal/objfile/objfile.go:157 +0x39d fp=0xc001d5eae8 sp=0xc001d5e950 pc=0x114e8ad
cmd/link/internal/objfile.Load(0x149b4e0, 0xc00005e140, 0xc0017ab230, 0xc0032ad180, 0xc0074bb2c0, 0x4c659, 0xc007451340, 0x68, 0x0, 0x1000)
	/usr/local/go/src/cmd/link/internal/objfile/objfile.go:103 +0x2c5 fp=0xc001d5ed20 sp=0xc001d5eae8 pc=0x114e175
cmd/link/internal/ld.ldobj(0xc000001680, 0xc0017ab230, 0xc0032ad180, 0x4c6c1, 0xc007451340, 0x68, 0xc000157f01, 0x60, 0x0)
	/usr/local/go/src/cmd/link/internal/ld/lib.go:1895 +0x112a fp=0xc001d5eed0 sp=0xc001d5ed20 pc=0x11b4f3a
cmd/link/internal/ld.loadobjfile(0xc000001680, 0xc0032ad180)
	/usr/local/go/src/cmd/link/internal/ld/lib.go:955 +0x494 fp=0xc001d5f068 sp=0xc001d5eed0 pc=0x11ac1b4
cmd/link/internal/ld.(*Link).loadlib(0xc000001680)
	/usr/local/go/src/cmd/link/internal/ld/lib.go:407 +0x296 fp=0xc001d5f200 sp=0xc001d5f068 pc=0x11a8cd6
cmd/link/internal/ld.Main(0x149b4e0, 0x10, 0x20, 0x1, 0x7, 0x10, 0x12c130d, 0x1b, 0x12bd4f3, 0x14, ...)
	/usr/local/go/src/cmd/link/internal/ld/main.go:210 +0xb42 fp=0xc001d5f358 sp=0xc001d5f200 pc=0x11c69c2
main.main()
	/usr/local/go/src/cmd/link/main.go:68 +0x1bc fp=0xc001d5ff88 sp=0xc001d5f358 pc=0x123ca7c
runtime.main()
	/usr/local/go/src/runtime/proc.go:203 +0x212 fp=0xc001d5ffe0 sp=0xc001d5ff88 pc=0x1034d42
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc001d5ffe8 sp=0xc001d5ffe0 pc=0x1062261
HARSHADMANE-MacBook-Pro:header-bidding harshadmane$ 

@randall77
Copy link
Contributor

@pm-harshad-mane That looks like a different issue. Can you open a new one?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants