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 [1.14 backport] #37478

Closed
gopherbot opened this issue Feb 26, 2020 · 30 comments
Closed

SIGILL: illegal instruction on any go tool under macOS [1.14 backport] #37478

gopherbot opened this issue Feb 26, 2020 · 30 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link
Contributor

@dmitshur requested issue #37459 to be considered for backport to the next 1.14 minor release.

@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 gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 26, 2020
@gopherbot gopherbot added this to the Go1.14.1 milestone Feb 26, 2020
@gopherbot
Copy link
Contributor Author

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

@UrbanLegend
Copy link

It also affects 10.13.6 (High Sierra)
ScreenShot

@randall77
Copy link
Contributor

@UrbanLegend I think you might be confusing macOS versions with Go versions.
This issue should not depend on the macOS version at all. It just requires Go 1.14 and an old processor.

@randall77 randall77 changed the title SIGILL: illegal instruction on any go tool under macOS 10.14.6 [1.14 backport] SIGILL: illegal instruction on any go tool under macOS [1.14 backport] Feb 27, 2020
@dmitshur
Copy link
Contributor

Approving per discussion in a release meeting because this is a serious issue without a workaround.

/cc @cagedmantis @toothrot

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Feb 27, 2020
@Jonconradt
Copy link

My configuration is having this problem. Here is the hardware and OS information:

System Version: macOS 10.14.6 (18G3020)
Kernel Version: Darwin 18.7.0
Model Name: Mac Pro
Model Identifier: MacPro5,1
Processor Name: Quad-Core Intel Xeon
Processor Speed: 2.26 GHz
Number of Processors: 2
Total Number of Cores: 8
L2 Cache (per Core): 256 KB
L3 Cache (per Processor): 8 MB
Hyper-Threading Technology: Enabled
Memory: 64 GB
Boot ROM Version: 144.0.0.0.0

@ghost
Copy link

ghost commented Mar 1, 2020

Chirping in with essentially the same config as @Jonconradt, except my Boot ROM is 138.0.0.0.0.

@cagedmantis
Copy link
Contributor

@cherrymui This issue has been approved. Feel free to merge when you have the opportunity.

@cherrymui
Copy link
Member

@cagedmantis I don't think I have permission to submit to the release branch. I'll have to let you or the release team do that. Thanks.

@cagedmantis
Copy link
Contributor

@cherrymui Sorry for the confusion.

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]>
@gopherbot
Copy link
Contributor Author

Closed by merging c54e369 to release-branch.go1.14.

@ghost
Copy link

ghost commented Mar 7, 2020

hi

i have same probleme but i can't see any solution :(

@randall77
Copy link
Contributor

The fix will be released when Go 1.14.1 comes out. For now, you will have to wait (or build a Go distribution for yourself, from tip or with the patch above applied to 1.14).

@ghost
Copy link

ghost commented Mar 7, 2020

@randall77 i'm so sorry,
how can i build or patch this ?

many thanks

@randall77
Copy link
Contributor

Something like:

git clone https://go.googlesource.com/go goroot
cd goroot
git checkout go1.14
git cherry-pick c54e36905b394dea9fbcf816c3a6e6751187258d
cd src
./make.bash

@ghost
Copy link

ghost commented Mar 7, 2020

hi @randall77
thank you for your help, i apply this but this issue not fix my problem.
i can't run hugo 0.66.0


SIGILL: illegal instruction
PC=0x406a670 m=0 sigcode=1

goroutine 1 [running, locked to thread]:
runtime.asyncPreempt()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/preempt_amd64.s:8 fp=0xc000169720 sp=0xc000169718 pc=0x406a670
github.com/alecthomas/chroma/lexers/r.init()
	/Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/github.com/alecthomas/[email protected]/lexers/r/racket.go:63 +0x21ea fp=0xc000169da8 sp=0xc000169720 pc=0x4679f6a
runtime.doInit(0x692a420)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5414 +0x8a fp=0xc000169dd8 sp=0xc000169da8 pc=0x40456aa
runtime.doInit(0x6938540)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169e08 sp=0xc000169dd8 pc=0x4045677
runtime.doInit(0x6931f40)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169e38 sp=0xc000169e08 pc=0x4045677
runtime.doInit(0x69300e0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169e68 sp=0xc000169e38 pc=0x4045677
runtime.doInit(0x6930080)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169e98 sp=0xc000169e68 pc=0x4045677
runtime.doInit(0x693c940)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169ec8 sp=0xc000169e98 pc=0x4045677
runtime.doInit(0x6932ec0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169ef8 sp=0xc000169ec8 pc=0x4045677
runtime.doInit(0x6941280)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169f28 sp=0xc000169ef8 pc=0x4045677
runtime.doInit(0x69408e0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169f58 sp=0xc000169f28 pc=0x4045677
runtime.doInit(0x69285a0)
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:5409 +0x57 fp=0xc000169f88 sp=0xc000169f58 pc=0x4045677
runtime.main()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/proc.go:190 +0x1ce fp=0xc000169fe0 sp=0xc000169f88 pc=0x4038aae
runtime.goexit()
	/usr/local/Cellar/go/1.14/libexec/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000169fe8 sp=0xc000169fe0 pc=0x4068df1

rax    0xc0003ac000
rbx    0x0
rcx    0x3e0
rdx    0x6728ec
rdi    0xc0003b2000
rsi    0x5d45760
rbp    0xc000169d98
rsp    0xc000169718
r8     0x8a3d9f7
r9     0x203000
r10    0x8
r11    0x75
r12    0xf5
r13    0x0
r14    0x5c19820
r15    0x0
rip    0x406a670
rflags 0x10206
cs     0x2b
fs     0x0
gs     0x0

@dmitshur
Copy link
Contributor

dmitshur commented Mar 7, 2020

@Shurikken From your log, it looks like the go binary that was in your PATH was still Go 1.14. Note that there are many mentions of /usr/local/Cellar/go/1.14 in your output.

It's possible the problem was that you didn't add the newly built go binary to your PATH after the ./make.bash step in the instructions @randall77 provided. Try this:

git clone https://go.googlesource.com/go gotip
cd gotip
git checkout go1.14
git cherry-pick c54e36905b394dea9fbcf816c3a6e6751187258d
cd src
./make.bash
export PATH="$(../bin/go env GOROOT)/bin:$PATH"
which go

which go should point to the go binary that was built in gotip/bin. Then, in the same terminal (to preserve the new PATH environment variable value), you can try go get github.com/gohugoio/[email protected] and see if that helps.

Thank you for helping confirm that this patch will fix the problem in the upcoming Go 1.14.1 release.

@ghost
Copy link

ghost commented Mar 7, 2020

@dmitshur hi

i have problem when use cd src ./make.bash :

MacBook-de-user:src acountuser$ ./make.bash
./make.bash: line 165: /Users/acountuser/go1.4/bin/go: No such file or directory
Building Go cmd/dist using /Users/acountuser/go1.4. ()
ERROR: Cannot find /Users/acountuser/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.
MacBook-de-valentin:src acountuser$ export PATH="$(../bin/go env GOROOT)/bin:$PATH"
-bash: ../bin/go: No such file or directory
MacBook-de-valentin:src acountuser$ which go
MacBook-de-valentin:src acountuser$ 

@dmitshur
Copy link
Contributor

dmitshur commented Mar 8, 2020

I see, the ./make.bash step failed because /Users/acountuser/go1.4/bin/go did not exist.

In order to run ./make.bash, you need to have another Go installation (any recent version that works for you) and set the GOROOT_BOOTSTRAP environment variable to point to it. Please see https://golang.org/doc/install/source#go14 for full details on this.

@randall77
Copy link
Contributor

The line number here:

/usr/local/Cellar/go/1.14/libexec/src/runtime/preempt_amd64.s:8 fp=0xc000169720 sp=0xc000169718 pc=0x406a670

corroborates the fact that you are still running a vanilla 1.14, not a patched one.

@ghost
Copy link

ghost commented Mar 8, 2020

Excuse me i'm newby.... :(
i use your solution and apply your code but when i use ./make.bash i have error code...
i have go installation
i don't understand why :(

@randall77
Copy link
Contributor

Show us. It's hard to debug for you when we can't see what you're doing.
Copy-paste your entire shell session here.

Perhaps you can just wait until 1.14.1 comes out.

@apriendeau
Copy link

@dmitshur do we have a timeline for the release of 1.14.1?

@dmitshur
Copy link
Contributor

@apriendeau We are actively making progress on the work that is necessary to get Go 1.14.1 and 1.13.9 releases out. I don't know the exact day it'll happen, but we're aiming to do it soon. /cc @toothrot @cagedmantis

@rageycomma
Copy link

rageycomma commented Mar 14, 2020

Method of resolving this if you have go installed using brew:
brew uninstall go && brew uninstall hugo
Then
brew install go && brew install hugo

This will remove an old version of go from your machine, then uninstall hugo compiled with that old version, then reinstall go at 1.14, then reinstall hugo which will compile it with 1.14. Easy peazy.

@randall77
Copy link
Contributor

Did brew patch the CL that fixes this issue into their Go 1.14? Because 1.14.1 with that CL is not out yet.

@chadwhitacre
Copy link

Method of resolving this if you have go installed using brew:

I just tried this and it didn't work.

Did brew patch the CL that fixes this issue into their Go 1.14?

Sooooooo ... no? :)

(P.S. Hi, @dmitshur! 👋 What interesting timing, this is my first time trying hugo. 😁)

@grahammiln
Copy link

grahammiln commented Mar 18, 2020

To revert a brew based install of Go to v1.13.8:

brew uninstall go
brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
brew pin [email protected]

To unpin and permit brew to update to the latest go:

brew unpin [email protected]

…and remove the previously inserted line from ~/.bash_profile.

@tmm1
Copy link
Contributor

tmm1 commented Mar 27, 2020

@apriendeau We are actively making progress on the work that is necessary to get Go 1.14.1 and 1.13.9 releases out. I don't know the exact day it'll happen, but we're aiming to do it soon. /cc @toothrot @cagedmantis

Any updates on a go1.14.1 release?

@randall77
Copy link
Contributor

go1.14.1 is out and has a fix for this issue.

@ianlancetaylor
Copy link
Member

For the record, all Go releases are announced on the low-volume golang-announce mailing list. For 1.14.1, see https://groups.google.com/d/msg/golang-announce/Ix2U_8WWmXo/a2nJkNW5AAAJ.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests