]> Cypherpunks repositories - gostls13.git/commit
runtime: stop preemption during syscall.Exec on Darwin
authorIan Lance Taylor <iant@golang.org>
Wed, 14 Oct 2020 23:03:48 +0000 (16:03 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 15 Oct 2020 18:30:07 +0000 (18:30 +0000)
commit64fb6ae95f1c322486cbfb758552bb8439a8e6e8
tree4d90fb975e548bdd470c13933813390a66dd7d47
parent497ea0610ea3757c6171cae3a85627459b572e5d
runtime: stop preemption during syscall.Exec 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.

Fixes #41702

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>
src/runtime/signal_unix.go
src/syscall/exec_unix_test.go