-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins
Milestone
Description
#!stacks
"panicdottypeI" && "inline.(*state).inlineCall:+159"
Issue created by stacks.
I audited the type checker for places that construct a variadic signature, and in all cases it derives from an Ellipsis as the final element of FuncType.Params.List, so the code below is sound. I think is yet another case of random memory corruption.
if sig.Variadic() {
lastParam := last(params)
... // ordinary/ellipsis call to variadic
// simplify decl: func(T...) -> func([]T)
lastParamField := last(calleeDecl.Type.Params.List)
lastParamField.Type = &ast.ArrayType{
Elt: lastParamField.Type.(*ast.Ellipsis).Elt, // panic: type assertion failedThis stack BVYdIg was reported by telemetry:
crash/crashruntime.gopanic:+69,+0x167runtime.panicdottypeE:=275,+0x70runtime.panicdottypeI:+5,+0x29golang.org/x/tools/internal/refactor/inline.(*state).inlineCall:+159,+0x428dgolang.org/x/tools/internal/refactor/inline.(*state).inline:+17,+0x27egolang.org/x/tools/internal/refactor/inline.Inline:+13,+0x95golang.org/x/tools/gopls/internal/golang.inlineAllCalls:+187,+0x167egolang.org/x/tools/gopls/internal/golang.rewriteCalls:+118,+0xb04golang.org/x/tools/gopls/internal/golang.ChangeSignature:+142,+0x1027golang.org/x/tools/gopls/internal/server.(*commandHandler).ChangeSignature.func1:+15,+0x195golang.org/x/tools/gopls/internal/server.(*commandHandler).run.func2:+3,+0x86golang.org/x/tools/gopls/internal/server.(*commandHandler).run:+81,+0x582golang.org/x/tools/gopls/internal/server.(*commandHandler).ChangeSignature:+3,+0x1aagolang.org/x/tools/gopls/internal/protocol/command.Dispatch:+45,+0x226egolang.org/x/tools/gopls/internal/server.(*server).ResolveCodeAction:+21,+0x1b8golang.org/x/tools/gopls/internal/protocol.serverDispatch:+46,+0xcd9golang.org/x/tools/gopls/internal/lsprpc.(*StreamServer).ServeStream.ServerHandler.func4:+5,+0x84
golang.org/x/tools/[email protected] go1.25.0 windows/amd64 vscode (6)
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins