Repository navigation
Open
Labels
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/telemetry-wins
Milestone
Description
#!stacks
"runtime.gopanic" && "go/types.(*Checker).fileFor:+11"
This stack vD1W8g was reported by telemetry:
// fileFor returns the *ast.File which contains the position pos.
// If there are no files, the result is nil.
// The position must be valid.
func (check *Checker) fileFor(pos token.Pos) *ast.File {
assert(pos.IsValid())
// Eval and CheckExpr tests may not have any source files.
if len(check.files) == 0 {
return nil
}
for _, file := range check.files {
if file.FileStart <= pos && pos < file.FileEnd {
return file
}
}
panic(check.sprintf("file not found for pos = %d (%s)", int(pos), check.fset.Position(pos))) // <--- here
}The root cause is #69477 in go/types.
crash/crash
runtime.gopanic:+69
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.(*Checker).fileFor:+11
go/types.(*Checker).allowVersion:+3
go/types.(*Checker).genericExprList:+21
go/types.(*Checker).callExpr:+127
go/types.(*Checker).exprInternal:+357
go/types.(*Checker).rawExpr:+10
go/types.(*Checker).multiExpr:+2
go/types.(*Checker).assignVars:+31
go/types.(*Checker).stmt:+116
go/types.(*Checker).simpleStmt:=99
go/types.(*Checker).stmt:+210
go/types.(*Checker).stmtList:+9
go/types.(*Checker).funcBody:+23
golang.org/x/tools/gopls@v0.16.1 go1.23.0 linux/amd64 vscode (2)
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
Dups: vEHlHQ rRko4w ipCG3g X0G-gQ YALHSA NQ7Z2w kShApw Y2vk_g
Metadata
Metadata
Assignees
Labels
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/telemetry-wins
Activity
gabyhelp commentedon Sep 7, 2024
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
adonovan commentedon Sep 7, 2024
This stack
vEHlHQwas reported by telemetry:Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
adonovan commentedon Sep 9, 2024
This stack
rRko4wwas reported by telemetry:Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
gopherbot commentedon Sep 17, 2024
Change https://go.dev/cl/613735 mentions this issue:
go/types: compute effective Go version independent of token.Posgo/types: compute effective Go version independent of token.Pos
adonovan commentedon Nov 19, 2024
This stack
ipCG3gwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).multiExpr:+2go/types.(*Checker).assignVars:+31go/types.(*Checker).stmt:+116go/types.(*Checker).stmtList:+9go/types.(*Checker).funcBody:+23go/types.(*Checker).funcDecl.func1:+1adonovan commentedon Nov 25, 2024
This stack
X0G-gQwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).multiExpr:+2go/types.(*Checker).exprList:+2go/types.(*Checker).builtin:+33go/types.(*Checker).callExpr:+60go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10This stack
YALHSAwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).stmt:+34go/types.(*Checker).stmtList:+9go/types.(*Checker).funcBody:+23go/types.(*Checker).funcDecl.func1:+1go/types.(*Checker).processDelayed:+16go/types.(*Checker).checkFiles:+32This stack
NQ7Z2wwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).use1:+32go/types.(*Checker).useN:=988go/types.(*Checker).use:=978go/types.(*Checker).callExpr:+20go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).stmt:+34go/types.(*Checker).stmtList:+9This stack
kShApwwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).genericExprList:+46go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).stmt:+34go/types.(*Checker).stmtList:+9go/types: compute effective Go version independent of token.Pos
adonovan commentedon Aug 4, 2025
This stack
Y2vk_gwas reported by telemetry:crash/crashruntime.gopanic:+69go/types.(*Checker).handleBailout:+7go/types.(*Checker).Files.deferwrap1:+0runtime.gopanic:+50go/types.(*Checker).fileFor:+11go/types.(*Checker).allowVersion:+3go/types.(*Checker).genericExprList:+21go/types.(*Checker).callExpr:+127go/types.(*Checker).exprInternal:+357go/types.(*Checker).rawExpr:+10go/types.(*Checker).expr:+1go/types.(*Checker).exprInternal:+140go/types.(*Checker).rawExpr:+10go/types.(*Checker).use1:+32go/types.(*Checker).useN:=988go/types.(*Checker).use:=978go/types.(*Checker).callExpr:+20go/types.(*Checker).exprInternal:+357