-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
runtime: macOS syscall.Exec can get SIGILL due to preemption signal #41702
Comments
@gopherbot Please open backport issues This issue can cause any Go program that uses |
Backport issue(s) opened: #41703 (for 1.14), #41704 (for 1.15). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
FYI, a bug was reportedly filed with Apple at https://feedbackassistant.apple.com/feedback/8759414 (but I can't see that report because I don't have an Apple ID). |
I have an Apple ID and I can't see it. |
I have access to the Google Apple account from which the report was filed (obtained for #33041 (comment)) and can confirm that that feedback report describes this issue. |
Change https://golang.org/cl/262438 mentions this issue: |
Change https://golang.org/cl/262717 mentions this issue: |
Change https://golang.org/cl/262737 mentions this issue: |
Change https://golang.org/cl/262738 mentions this issue: |
Change https://golang.org/cl/262817 mentions this issue: |
Reopening until CL 262817 is submitted. (Test is failing right now.) |
For #41702 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
…on Darwin On current macOS versions a program that receives a signal during an execve can fail with a SIGILL signal. This appears to be a macOS kernel bug. It has been reported to Apple. This CL partially works around the problem by using execLock to not send preemption signals during execve. Of course some other stray signal could occur, but at least we can avoid exacerbating the problem. We can't simply disable signals, as that would mean that the exec'ed process would start with all signals blocked, which it likely does not expect. For #41702 Fixes #41703 Change-Id: I91b0add967b315671ddcf73269c4d30136e579b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/262438 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 64fb6ae) Reviewed-on: https://go-review.googlesource.com/c/go/+/262737
…on Darwin On current macOS versions a program that receives a signal during an execve can fail with a SIGILL signal. This appears to be a macOS kernel bug. It has been reported to Apple. This CL partially works around the problem by using execLock to not send preemption signals during execve. Of course some other stray signal could occur, but at least we can avoid exacerbating the problem. We can't simply disable signals, as that would mean that the exec'ed process would start with all signals blocked, which it likely does not expect. For #41702 Fixes #41704 Change-Id: I91b0add967b315671ddcf73269c4d30136e579b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/262438 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 64fb6ae) Reviewed-on: https://go-review.googlesource.com/c/go/+/262717
Change https://golang.org/cl/264020 mentions this issue: |
Change https://golang.org/cl/264021 mentions this issue: |
Change https://golang.org/cl/264022 mentions this issue: |
Change https://golang.org/cl/264023 mentions this issue: |
For #41702 For #41703 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 11cfb48) Reviewed-on: https://go-review.googlesource.com/c/go/+/264021
For #41702 For #41704 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 11cfb48) Reviewed-on: https://go-review.googlesource.com/c/go/+/264020
…yscall.Exec For #41702 For #41704 For #42023 Change-Id: If07f40b1d73b8f276ee28ffb8b7214175e56c24d Reviewed-on: https://go-review.googlesource.com/c/go/+/262817 Trust: Ian Lance Taylor <[email protected]> Trust: Bryan C. Mills <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 05739d6) Reviewed-on: https://go-review.googlesource.com/c/go/+/264022
…yscall.Exec For #41702 For #41703 For #42023 Change-Id: If07f40b1d73b8f276ee28ffb8b7214175e56c24d Reviewed-on: https://go-review.googlesource.com/c/go/+/262817 Trust: Ian Lance Taylor <[email protected]> Trust: Bryan C. Mills <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 05739d6) Reviewed-on: https://go-review.googlesource.com/c/go/+/264023
…on Darwin On current macOS versions a program that receives a signal during an execve can fail with a SIGILL signal. This appears to be a macOS kernel bug. It has been reported to Apple. This CL partially works around the problem by using execLock to not send preemption signals during execve. Of course some other stray signal could occur, but at least we can avoid exacerbating the problem. We can't simply disable signals, as that would mean that the exec'ed process would start with all signals blocked, which it likely does not expect. For golang#41702 Fixes golang#41704 Change-Id: I91b0add967b315671ddcf73269c4d30136e579b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/262438 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 64fb6ae) Reviewed-on: https://go-review.googlesource.com/c/go/+/262717
For golang#41702 For golang#41704 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 11cfb48) Reviewed-on: https://go-review.googlesource.com/c/go/+/264020
…yscall.Exec For golang#41702 For golang#41704 For golang#42023 Change-Id: If07f40b1d73b8f276ee28ffb8b7214175e56c24d Reviewed-on: https://go-review.googlesource.com/c/go/+/262817 Trust: Ian Lance Taylor <[email protected]> Trust: Bryan C. Mills <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> (cherry picked from commit 05739d6) Reviewed-on: https://go-review.googlesource.com/c/go/+/264022
Change https://golang.org/cl/275293 mentions this issue: |
The iOS kernel has the same problem as the macOS kernel. Extend the workaround of #41702 (CL 262438 and CL 262817) to iOS. Updates #35851. Change-Id: I7ccec00dc96643c08c5be8b385394856d0fa0f64 Reviewed-on: https://go-review.googlesource.com/c/go/+/275293 Trust: Cherry Zhang <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
On macOS 10.14 and 10.15 (at least) a Go program calling
syscall.Exec
can fail due toSIGILL
in the newly execed image because of preemption signals.This is a bug in macOS. Here is a C program that demonstrates the problem. This program will occasionally fail with
SIGILL
.For Go, we should have a workaround, which means in
syscall.Exec
we should disable preemption via signal. We already have hooks that we can use for this (syscall.runtime_BeforeExec
andsyscall.runtime_AfterExec
).The text was updated successfully, but these errors were encountered: