go: 1.26.8, whose race detector leaves a forked child alone before exec on macOS (#1184)
macOS race CI failed now and then with "write |1: file already closed" on a Claude subscription run's first prompt (TestClaudeAuthFailureFallsBackWithoutRetryingTheLogin in 37605014029, TestClaudeLastWordsAreRead in 37464400652; 37612795871 got the same failure as "broken pipe"). The Claude Code stand-in had already ended when the first prompt was written, and Wait had closed its stdin. It never ran. On the fork's macOS runners, a debug build that recorded the process's status at the failed write caught 8 cases in 10 jobs. Each was "signal: segmentation fault", under 1ms of CPU, nothing on stderr, with no magpie abort or group kill. The crash report (gateway.race-*.ips) says "crashed on child side of fork pre-exec": __tsan::TraceSwitchPartImpl syscall.rawSyscall syscall.forkAndExecInChild syscall.forkExec os.StartProcess exec.(*Cmd).Start proc.StartTree gateway.(*subscriptionRun).launch This is golang/go#79804. From Go 1.26.0, darwin's raw syscall wrappers are instrumented under -race, and forkAndExecInChild calls them in the child of fork. Go 1.26.5 marks them //go:norace (#79806); go.mod's 1.26.3, which setup-go builds CI with, has the bug. Only -race test binaries on macOS are affected, so released builds never were. Any os/exec start in a macOS race test could hit it; the Claude subscription tests were where it surfaced. Local runs on go1.27.1 couldn't reproduce it, because that release already has the fix. 1.26.8 is the latest 1.26 patch release.
This commit is contained in:
1 parent
d151c10839
commit
e4882f91de
1 file changed
+1
-1