Closed
Description
#!stacks
"sigpanic" && "modindex.(*Index).Lookup" && "cache.(*goplsSource).resolveCacheReferences"
Issue created by stacks.
func (s *goplsSource) resolveCacheReferences(missing imports.References) ([]*result, error) {
ix, err := s.S.view.ModcacheIndex()
if err != nil {
event.Error(s.ctx, "resolveCacheReferences", err) <----------- missing return
}
found := make(map[string]*result)
for pkg, nms := range missing {
var ks []string
for k := range nms {
ks = append(ks, k)
}
cs := ix.LookupAll(pkg, ks...) // map[importPath][]Candidate <-------- panics within here
This stack sKaGhw
was reported by telemetry:
crash/crash
runtime.gopanic:+69,+0x153
runtime.panicmem:=262,+0x2ff
runtime.sigpanic:+19,+0x2cc
golang.org/x/tools/internal/modindex.(*Index).Lookup:+1,+0x38
golang.org/x/tools/internal/modindex.(*Index).LookupAll:+5,+0x9f
golang.org/x/tools/gopls/internal/cache.(*goplsSource).resolveCacheReferences:+12,+0x16b
golang.org/x/tools/gopls/internal/cache.(*goplsSource).ResolveReferences:+16,+0x143
golang.org/x/tools/internal/imports.addExternalCandidates:+4,+0x97
golang.org/x/tools/internal/imports.getFixesWithSource:+73,+0x2df
golang.org/x/tools/internal/imports.FixImports:+12,+0x13f
golang.org/x/tools/gopls/internal/golang.computeImportEdits:+24,+0x20f
golang.org/x/tools/gopls/internal/golang.allImportsFixes.func1:+1,+0x4b
golang.org/x/tools/gopls/internal/cache.(*importsState).runProcessEnvFunc:+42,+0x2e3
golang.org/x/tools/gopls/internal/cache.(*Snapshot).RunProcessEnvFunc:=414,+0xbf
golang.org/x/tools/gopls/internal/golang.allImportsFixes:+4,+0x70
golang.org/x/tools/gopls/internal/golang.(*allImportsFixesResult).init:+1,+0x43
golang.org/x/tools/gopls/internal/golang.lazyInit[...]:+8,+0xa3
golang.org/x/tools/gopls/internal/golang.sourceOrganizeImports:+1,+0x43
golang.org/x/tools/gopls@v0.19.0-pre.2 go1.24.3 darwin/arm64 other,vscode (1)
Dups: nSR9Wg x4Uhuw oAH9Ug 6exHug SO76sQ b_Sm8g MWR90Q MigjvA gwPnLQ iArnDA