-
Notifications
You must be signed in to change notification settings - Fork 19k
cmd/go: frequent SEGV without stderr text [darwin, go1.26+tip] #78627
Copy link
Copy link
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.Go Command Working GroupGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.Go Command Working GroupGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Type
Projects
Status
Todo
For months various gopls tests have been flaky in CI every day following a pattern in which invocations of the go command (e.g. list env, version) fail with SIGSEGV and no output. See for example the most recent dozens of notes on #75107. The failures are always on darwin but affect both amd64 and arm64. Both go1.26 and tip toolchains are affected. (Ignore the handful of linux, mips, etc notes, which are outliers not following this pattern.)
The details below imply that it is the go command itself that is signaled. Why is this happening? Why is it not printing a backtrace?
Here is a typical example:
The "failed to load view" error comes from server.addFolders in gopls. The prefix of the error string indicates that it came from server.addView. From there it must have come from this return tree:
All viable leaves are in gocommand.Runner.Run, which is consistent with the text of the error message string produced by Invocation.runWithFriendlyError. The error text implies that friendlyError="signal: segmentation fault" and stderr="". friendlyError comes from Invocation.run, thence from runCmdContext, cmd.Wait (not os.Pipe). From there it almost certainly came from os.Process.Wait: it looks to be an ExitError for a process state of signaled by SEGV.
So the go command itself (not one of its child processes) suffered a segmentation fault.