-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
"gopanic" && "go/types.(*operand).setConst:+14" && "go/types.(*Checker).basicLit:+20"
Issue created by stacks.
A BasicLit.Kind other than INT, FLOAT, IMAG, CHAR, STRING cannot result from the parser, and there are no assignments in x/tools that update the Kind field. Every place in x/tools that constructs a BasicLit fills in the Kind field to one of these values (except in gopls/internal/golang/undeclared.go, but that AST is only fed to format.Node). So this means the AST has become corrupted.
This stack -JV2Tg was reported by telemetry:
crash/crashruntime.gopanic:+69,+0x167go/types.(*Checker).handleBailout:+25,+0x96go/types.(*Checker).Files.deferwrap1:+0,+0x24runtime.gopanic:+50,+0x131go/types.(*operand).setConst:+14,+0x184go/types.(*Checker).basicLit:+20,+0x84go/types.(*Checker).exprInternal:+19,+0x19ego/types.(*Checker).rawExpr:+10,+0x18bgo/types.(*Checker).expr:+1,+0x2fgo/types.(*Checker).binary:+4,+0xcbgo/types.(*Checker).exprInternal:+134,+0x8e4go/types.(*Checker).rawExpr:+10,+0x18bgo/types.(*Checker).expr:+1,+0x2fgo/types.(*Checker).stmt:+200,+0x10cego/types.(*Checker).stmtList:+9,+0x84go/types.(*Checker).stmt:+192,+0x56d
golang.org/x/tools/gopls@v0.21.0 go1.25.5 windows/amd64 gopls.client=other,vscode (1)
Use this command to reproduce the executable:
(HOME=$(mktemp -d); GOOS=windows GOARCH=amd64 GOTOOLCHAIN=go1.25.5 go install golang.org/x/tools/gopls@v0.21.0 && find $HOME/go/bin -type f)
To disassemble: go tool objdump exe | less
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