x/tools/gopls: objectpath: panic due to nil *types.Signature
Opened this issue · 1 comments
adonovan commented
#!stacks
"sigpanic" && "(*Signature).RecvTypeParams" && "objectpath.(*finder).find:+22"
Issue created by stacks.
Possible type checker bug: the parameter of an interface method is a alias to a nil signature. Invalid code that uses interface methods and aliases have been a fertile source of bugs due to cycles and ordering subtleties. Also possibly memory corruption.
This stack olW9_w was reported by telemetry:
crash/crashruntime.gopanic:+69,+0x153runtime.panicmem:=262,+0x2ffruntime.sigpanic:+19,+0x2ccgo/types.(*Signature).RecvTypeParams:=90,+0x3a4golang.org/x/tools/go/types/objectpath.(*finder).find:+22,+0x3a8golang.org/x/tools/go/types/objectpath.(*finder).find:+3,+0x2dbgolang.org/x/tools/go/types/objectpath.(*finder).find:+51,+0xb3fgolang.org/x/tools/go/types/objectpath.(*finder).find:+28,+0x457golang.org/x/tools/go/types/objectpath.(*finder).find:+70,+0x977golang.org/x/tools/go/types/objectpath.find:=458,+0x847golang.org/x/tools/go/types/objectpath.(*Encoder).For:+128,+0x7acgolang.org/x/tools/go/types/objectpath.(*Encoder).For-fm:+0,+0x3bgolang.org/x/tools/gopls/internal/cache/xrefs.Index-range1:+20,+0x20bgolang.org/x/tools/go/ast/inspector.Cursor.Preorder.func1:+6,+0xbfgolang.org/x/tools/gopls/internal/cache/xrefs.Index:+21,+0x1f7golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs.func1:+1,+0x37sync.(*Once).doSlow:+5,+0xefsync.(*Once).Do:=69,+0x47golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs:+1,+0x18golang.org/x/tools/gopls/internal/cache.storePackageResults:+2,+0x87
golang.org/x/tools/gopls@v0.20.0 go1.24.5 darwin/arm64 neovim (1)
findleyr commented
I suspect a type checker bug here, rather than memory corruption. Without a reproducer, it may be impossible to fix.