-
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
"sigpanic" && "go/ast.(*BlockStmt).End:+1" && "go/types.(*Checker).openScope"
Issue created by stacks.
IfStmt.Body is nil (or invalid). This can't happen in the result of the parser, ergo more memory corruption.
This stack p7b91g was reported by telemetry:
crash/crashruntime.throw:+9,+0x47runtime.sigpanic:+33,+0x26bgo/ast.(*BlockStmt).End:+1,+0xego/ast.(*IfStmt).End:+4,+0x30go/types.(*Checker).openScope:+1,+0x54go/types.(*Checker).stmt:+195,+0x1033go/types.(*Checker).stmtList:+9,+0x84go/types.(*Checker).funcBody:+24,+0x310go/types.(*Checker).funcDecl.func1:+1,+0x39go/types.(*Checker).processDelayed:+18,+0x1e1go/types.(*Checker).checkFiles:+32,+0x2f8go/types.(*Checker).Files:+13,+0x74golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage:+73,+0x9dbgolang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage.func1:+49,+0x3c6golang.org/x/tools/gopls/internal/cache.(*futureCache[...]).get:+32,+0x3cdgolang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage:+1,+0x52
golang.org/x/tools/gopls@v0.20.0 go1.25.0 linux/amd64 gopls.client=vscode (1)
Use this command to reproduce the executable:
(HOME=$(mktemp -d); GOOS=linux GOARCH=amd64 GOTOOLCHAIN=go1.25.0 go install golang.org/x/tools/gopls@v0.20.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