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

runtime: macOS syscall.Exec can get SIGILL due to preemption signal [1.14 backport] #41703

Closed
gopherbot opened this issue Sep 30, 2020 · 5 comments
Closed

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 30, 2020

@ianlancetaylor requested issue #41702 to be considered for backport to the next 1.14 minor release.

@gopherbot Please open backport issues

This issue can cause any Go program that uses syscall.Exec on macOS to crash during the exec. We should backport the fix (when we have it) so that this will work for older releases.

@toothrot
Copy link
Contributor

@toothrot toothrot commented Oct 15, 2020

Approved. This is a serious issue with no workaround.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 15, 2020

Change https://golang.org/cl/262737 mentions this issue: [release-branch.go1.14] runtime: stop preemption during syscall.Exec on Darwin

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

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

@gopherbot gopherbot closed this Oct 20, 2020
gopherbot pushed a commit that referenced this issue Oct 20, 2020
…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 <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 64fb6ae)
Reviewed-on: https://go-review.googlesource.com/c/go/+/262737
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

Change https://golang.org/cl/264021 mentions this issue: [release-branch.go1.14] syscall: use MustHaveExec in TestExec

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

Change https://golang.org/cl/264023 mentions this issue: [release-branch.go1.14] runtime: wait for preemption signals before syscall.Exec

gopherbot pushed a commit that referenced this issue Oct 20, 2020
For #41702
For #41703

Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/262738
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 11cfb48)
Reviewed-on: https://go-review.googlesource.com/c/go/+/264021
gopherbot pushed a commit that referenced this issue Oct 20, 2020
…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 <iant@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 05739d6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/264023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants