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.15 backport] #41704

Closed
gopherbot opened this issue Sep 30, 2020 · 5 comments
Closed
Labels
CherryPickApproved FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 30, 2020

@ianlancetaylor requested issue #41702 to be considered for backport to the next 1.15 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.

@gopherbot gopherbot added the CherryPickCandidate label Sep 30, 2020
@gopherbot gopherbot added this to the Go1.15.3 milestone Sep 30, 2020
@toothrot toothrot removed this from the Go1.15.3 milestone Oct 14, 2020
@toothrot toothrot added this to the Go1.15.4 milestone Oct 14, 2020
@toothrot toothrot added the CherryPickApproved label Oct 15, 2020
@toothrot
Copy link
Contributor

@toothrot toothrot commented Oct 15, 2020

Approved. This is a serious issue with no workaround.

@gopherbot gopherbot removed the CherryPickCandidate label Oct 15, 2020
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 15, 2020

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

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

Closed by merging 9c7eb68 to release-branch.go1.15.

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 #41704

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/+/262717
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

Change https://golang.org/cl/264020 mentions this issue: [possible] syscall: use MustHaveExec in TestExec

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 20, 2020

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

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

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/+/264020
gopherbot pushed a commit that referenced this issue Oct 20, 2020
…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 <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/+/264022
claucece pushed a commit to claucece/go that referenced this issue Oct 22, 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 golang#41702
Fixes golang#41704

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/+/262717
claucece pushed a commit to claucece/go that referenced this issue Oct 22, 2020
For golang#41702
For golang#41704

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/+/264020
claucece pushed a commit to claucece/go that referenced this issue Oct 22, 2020
…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 <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/+/264022
@golang golang locked and limited conversation to collaborators Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants