#!stacks
"sigpanic" && "reflect.(*rtype).common" && "reflect.(*rtype).Implements"
Issue created by stacks.
func (t *rtype) Implements(u Type) bool {
if u == nil {
panic("reflect: nil type passed to Type.Implements")
}
if u.Kind() != Interface {
panic("reflect: non-interface type passed to Type.Implements")
}
return implements(u.common(), t.common()) // <--- panics because u is nil (or SP is corrupt), but u cannot be nil
}
func (t *rtype) common() *abi.Type {
return &t.t // <--- panic
}
This stack 2veB9A
was reported by telemetry:
crash/crash
runtime.throw:+9,+0x37
runtime.sigpanic:+33,+0x223
reflect.(*rtype).common:=324,+0x58
reflect.(*rtype).Implements:+7,+0x44
encoding/json.newTypeEncoder:+5,+0x73
encoding/json.typeEncoder:+23,+0x15b
encoding/json.typeFields:+206,+0x567
encoding/json.cachedTypeFields:+4,+0xdb
encoding/json.(*decodeState).object:+48,+0x20f
encoding/json.(*decodeState).value:+17,+0x3f
encoding/json.(*decodeState).unmarshal:+10,+0xff
encoding/json.(*Decoder).Decode:+24,+0x117
golang.org/x/tools/go/packages.(*golistState).createDriverResponse:+32,+0x227
golang.org/x/tools/go/packages.goListDriver:+71,+0x6c3
golang.org/x/tools/go/packages.defaultDriver.func1:+1,+0x43
golang.org/x/tools/go/packages.callDriverOnChunks.func1:+1,+0x5f
golang.org/x/sync/errgroup.(*Group).add.func1:+32,+0x87
golang.org/x/tools/gopls@v0.19.1 go1.24.4 darwin/arm64 other,vscode (1)
Comment From: gabyhelp
Related Issues
- x/tools/gopls: impossible nil panic in reflect.ValueOf #73853
- x/tools/gopls: Implementation (by signatures): nil panic in dynamicFuncCallType #74305 (closed)
- x/tools/gopls: Inline call: panic in reflect.Value.Set #74653
- x/tools/gopls: nil *types.Package panic in testKind #73096 (closed)
- x/tools/gopls: Package.Path called on nil Package in AddTestForFunc #73687 (closed)
- x/tools/gopls: Hover: invalid nil entry in types.Defs map #69362 (closed)
- x/tools/gopls: Hover: nil deref in typeDeclContent #74056 (closed)
- x/tools/gopls: Completion: nil deref in expectedCompositeLiteralType #72136 (closed)
- x/tools/gopls: nil Signature (?) deref in Completion #70634 (closed)
- go/types: panic("t.fromRHS = %s, typ = %s") in setDefType #71029 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)