Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: crashes due to apparent data race (gopls v16+ on linux) #71425

Open
findleyr opened this issue Jan 24, 2025 · 4 comments
Open
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Member

findleyr commented Jan 24, 2025

While we've found and fixed many gopls crashes thanks to telemetry, as we gain more users it appears we're accumulating a long tail of issues that "can't happen" based on easily verifiable local invariants.

In some cases, these were related to misreporting of stacks by the runtime (#70637), but others cannot be explained by a misreported stack, and indicate some form of memory corruption or (most likely) data race.

This issue is an umbrella for those bugs. @adonovan and I will consolidate them here.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jan 24, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 24, 2025
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@adonovan
Copy link
Member

adonovan commented Mar 14, 2025

Fun fact: with one exception, all of the attached "can't happen" telemetry issues are from gopls/v0.17 on linux/amd64, even though linux accounts for only 22% of gopls users. I'm going to tentatively call this a linux-specific bug introduced after gopls 15. (Recall that 16 had broken telemetry.)

This is the current set of all reports:

golang.org/x/tools/[email protected] go1.23.2 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.23.2 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 vscode (1)

It's conceivable that all come from a single VS Code user with faulty hardware, though unlikely since there are 3 distinct gopls/Go version combinations here. (Maybe they were frantically upgrading after crashes?)

The exception is #71067, from gopls/v0.15 on darwin/arm64, and which could be explained by a bug in IExportShallow. I will split it out.

@adonovan adonovan changed the title x/tools/gopls: crashes due to apparent data race(s) x/tools/gopls: crashes due to apparent data race (gopls v16+ on linux) Mar 14, 2025
@adonovan
Copy link
Member

@findleyr Perhaps you could run gopls built with -race for a while? I've been doing it on my mac, but no problems so far.

@adonovan
Copy link
Member

The latest associated issue (#72931) is something new:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants