diff options
| author | Russ Cox <rsc@golang.org> | 2023-01-04 09:18:02 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-01-10 20:34:19 +0000 |
| commit | 0a0de0fc4241c7531860e3c1a03ab4a4643ec37f (patch) | |
| tree | 22a668955d1905d39e4c368365051628863f3010 /src/syscall/exec_libc2.go | |
| parent | 82f09b75ca181a6be0e594e1917e4d3d91934b27 (diff) | |
| download | go-0a0de0fc4241c7531860e3c1a03ab4a4643ec37f.tar.xz | |
runtime: revert use of __fork to work around Apple atfork bugs
An Apple engineer suggests that since __fork is not public API,
it would be better to use a different fix. With the benefit of source code,
they suggest using xpc_date_create_from_current instead of
xpc_atfork_child. The latter sets some flags that disable certain
functionality for the remainder of the process lifetime (expecting exec),
while the former should do the necessary setup.
Reverting the __fork fix in order to prepare a clean fix based
on CL 451735 using xpc_date_create_from_current.
This reverts commit c61d322d5f9e3fcffa4c523892af432dca030c12.
Change-Id: I2da293ff537237ffd2d40ad756d827c95c84635b
Reviewed-on: https://go-review.googlesource.com/c/go/+/460475
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/syscall/exec_libc2.go')
| -rw-r--r-- | src/syscall/exec_libc2.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/syscall/exec_libc2.go b/src/syscall/exec_libc2.go index 6e3c2bf9d7..41bc79a721 100644 --- a/src/syscall/exec_libc2.go +++ b/src/syscall/exec_libc2.go @@ -78,7 +78,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr // About to call fork. // No more allocation or calls of non-assembly functions. runtime_BeforeFork() - r1, _, err1 = rawSyscall(forkTrampoline, 0, 0, 0) + r1, _, err1 = rawSyscall(abi.FuncPCABI0(libc_fork_trampoline), 0, 0, 0) if err1 != 0 { runtime_AfterFork() return 0, err1 @@ -276,6 +276,6 @@ childerror: // send error code on pipe rawSyscall(abi.FuncPCABI0(libc_write_trampoline), uintptr(pipe), uintptr(unsafe.Pointer(&err1)), unsafe.Sizeof(err1)) for { - rawSyscall(exitTrampoline, 253, 0, 0) + rawSyscall(abi.FuncPCABI0(libc_exit_trampoline), 253, 0, 0) } } |
