Skip to content

x/tools/gopls: nil deref in evaluatePackageHandle (telemetry) #69236

Closed
@adonovan

Description

@adonovan

This stack kRRIIg was reported by telemetry:

We don't have a program counter, so we can't tell if it is succ or succ.ph that is nil. (We know n.ph.depKeys is non-nil.)

	reachable := b.s.pkgIndex.NewSet()
	for depID, succ := range n.succs {
		n.ph.depKeys[depID] = succ.ph.key // panic
		reachable.Add(succ.idxID)
crash/crash
runtime.gopanic:+69
runtime.panicmem:=262
runtime.sigpanic:+19
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).evaluatePackageHandle:+26
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).buildPackageHandle:+35
golang.org/x/tools/gopls/internal/cache.(*Snapshot).getPackageHandles.func2.1:+8
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.16.1 go1.23.0 linux/amd64 vscode (1)
golang.org/x/tools/gopls@v0.16.1 go1.23.0 darwin/arm64 other,vscode (1)

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

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone 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

Relationships

None yet

Development

No branches or pull requests

Issue actions