syscall: add //go:norace to rawSyscall on darwin#79805
Conversation
On darwin, rawSyscall, rawSyscall6, and rawSyscall9 are Go functions (not assembly as on Linux) that get race-detector instrumentation. When forkAndExecInChild calls rawSyscall in the forked child process, the TSan ThreadState pointer is invalid, causing SIGSEGV in TraceSwitchPartImpl. Add //go:norace to these functions so the race detector does not instrument them. Also update the stale comment in exec_libc2.go that referred to rawSyscall as assembly. Fixes golang#79804
|
This PR (HEAD: 351555f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/786620. Important tips:
|
|
Message from t hepudds: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-06-03T14:24:34Z","revision":"bac5dc29d1cbca9323a0500e219fe3c6127d4132"} Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from t hepudds: Patch Set 1: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_28792>) Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 1: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 1: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from Michael Pratt: Patch Set 1: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from Quim Muntal: Patch Set 1: Code-Review+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
This PR (HEAD: 21d5744) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/786620. Important tips:
|
|
Message from Sébastien Tardif: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from t hepudds: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-06-03T23:26:50Z","revision":"cac733bc14569e51d27701420a8379cee2bfd721"} Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from t hepudds: Patch Set 2: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_28792>) Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/786620. |
On darwin, rawSyscall, rawSyscall6, and rawSyscall9 are Go
functions (not assembly as on Linux) that get race-detector
instrumentation. When forkAndExecInChild calls rawSyscall in
the forked child process, the TSan ThreadState pointer is
invalid, causing SIGSEGV in TraceSwitchPartImpl.
Add //go:norace to these functions so the race detector does
not instrument them. Also update the stale comment in
exec_libc2.go that referred to rawSyscall as assembly.
Fixes #79804