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: CodeAction: unexpected JSON unmarshalling error in BundledLazyFixes (via telemetry) #68819

Open
adonovan opened this issue Aug 9, 2024 · 2 comments
Labels
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

@adonovan
Copy link
Member

adonovan commented Aug 9, 2024

This stack pA-Ukg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report: 35
golang.org/x/tools/gopls/internal/util/bug.Reportf: 1
golang.org/x/tools/gopls/internal/cache.BundledLazyFixes: 5
golang.org/x/tools/gopls/internal/server.(*server).codeActionsMatchingDiagnostics: 4
golang.org/x/tools/gopls/internal/server.(*server).CodeAction: 96
golang.org/x/tools/gopls/internal/protocol.serverDispatch: 160
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3: 5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4: 52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1: 2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2: 3
runtime.goexit: 0
golang.org/x/tools/[email protected] go1.22.4 darwin/arm64 other (2)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. gopls/telemetry-wins labels Aug 9, 2024
@gopherbot gopherbot added this to the Unreleased milestone Aug 9, 2024
@adonovan
Copy link
Member Author

Given the analysis in #64503 (comment), and the fact the hypothesis (3) is no longer possible due to https://go.dev/cl/549575, hypothesis (1) seems likely: "a curious user or misbehaving client is sending home-made or invalid BundledFixes messages, or modifying the value before returning it to the server". The fact that the the LSP client string is "other" adds a small amount of evidentiary weight.

We should probably downgrade the bug.Report to silently discard the message on the grounds that the client has meddled with it, or, better, report an ordinary error to be handled by the caller.

@adonovan adonovan removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 12, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.17.0 Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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