Skip to content

internal/refactor/inline: "args/params mismatch" panic (reported by telemetry) #64558

@adonovan

Description

@adonovan

This stack u0ujVg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/bug.report:35
golang.org/x/tools/gopls/internal/bug.Errorf:2
golang.org/x/tools/gopls/internal/lsp/source.inlineCall.func2:2
runtime.gopanic:88
golang.org/x/tools/internal/refactor/inline.assert:?2133
golang.org/x/tools/internal/refactor/inline.createBindingDecl:77
golang.org/x/tools/internal/refactor/inline.inline:345
golang.org/x/tools/internal/refactor/inline.Inline:15
golang.org/x/tools/gopls/internal/lsp/source.inlineCall:64
golang.org/x/tools/gopls/internal/lsp/source.ApplyFix:5
golang.org/x/tools/gopls/internal/lsp.(*commandHandler).ApplyFix.func1:1
golang.org/x/tools/gopls/internal/lsp.(*commandHandler).run.func1:2
golang.org/x/tools/gopls/internal/lsp.(*commandHandler).run:72
golang.org/x/tools/gopls/internal/lsp.(*commandHandler).ApplyFix:1
golang.org/x/tools/gopls/internal/lsp/command.Dispatch:25
golang.org/x/tools/gopls/internal/lsp.(*Server).executeCommand:19
golang.org/x/tools/gopls@v0.14.2 go1.21.3 darwin/arm64 (1)

createBindingDecl:77 is

	assert(len(values) == 0, "args/params mismatch")

The stack indicates that this refactoring was applied to ill-typed code (hence the recover in source.inlineCall), and the inliner is generally not robust against ill-typed inputs. So potentially this is working as intended, though we should investigate first.

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

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/telemetry-wins

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions