{"record":{"id":"7e39f27e3b78de61","repo":"go-delve/delve","slug":"invalid-interface-type-v-7e39f2","errorCode":null,"errorMessage":"invalid interface type: %v","messagePattern":"invalid interface type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/variables.go","lineNumber":2091,"sourceCode":"\n\t// +rtype -field iface.tab *itab|*internal/abi.ITab\n\t// +rtype -field iface.data unsafe.Pointer\n\t// +rtype -field eface._type *_type|*internal/abi.Type\n\t// +rtype -field eface.data unsafe.Pointer\n\n\tfor _, f := range ityp.Field {\n\t\tswitch f.Name {\n\t\tcase \"tab\": // for runtime.iface\n\t\t\ttab, _ := v.toField(f) // +rtype *itab|*internal/abi.ITab\n\t\t\ttab = tab.maybeDereference()\n\t\t\tisnil = tab.Addr == 0\n\t\t\tif !isnil {\n\t\t\t\tvar err error\n\t\t\t\t_type, err = tab.structField(\"Type\") // +rtype *internal/abi.Type\n\t\t\t\tif err != nil {\n\t\t\t\t\t_type, err = tab.structField(\"_type\") // +rtype *_type|*internal/abi.Type\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tv.Unreadable = fmt.Errorf(\"invalid interface type: %v\", err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"_type\": // for runtime.eface\n\t\t\t_type, _ = v.toField(f)\n\t\t\tisnil = _type.maybeDereference().Addr == 0\n\t\tcase \"data\":\n\t\t\tdata, _ = v.toField(f)\n\t\t}\n\t}\n\treturn\n}\n\nfunc (v *Variable) loadInterface(recurseLevel int, loadData bool, cfg LoadConfig) {\n\t_type, data, isnil := v.readInterface()\n\n\tif isnil {","sourceCodeStart":2073,"sourceCodeEnd":2109,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/variables.go#L2073-L2109","documentation":"When unwrapping an interface value, Delve reads the itab's type pointer field. It first tries the field named 'Type' (internal/abi.Itab layout) then falls back to '_type' (older runtime layouts); if neither struct field exists in the itab DWARF type, the interface is marked unreadable.","triggerScenarios":"Printing an iface-typed value whose itab struct type (from the binary's runtime DWARF) lacks both 'Type' and '_type' fields — usually a Go version mismatch between the debugger's expectations and the debuggee runtime, or missing runtime DWARF.","commonSituations":"Debugging a binary built with a Go runtime whose internal abi.Type layout differs from what Delve expects; core dumps with incomplete runtime type info; optimized/stripped runtimes.","solutions":["Rebuild the debuggee with a Go version supported by your Delve build (or upgrade Delve to match the Go version)","Verify the binary includes DWARF for the runtime package (don't strip with -w)","Check the runtime ABI layout: search the binary's DWARF for internal/abi.Itab field names","If inspecting a core dump, ensure the core and binary are from the same build"],"exampleFix":"// before: mismatched toolchain\ngo build -gcflags=\"-N -l\" main.go   // built with go1.9-era runtime\n// after\ngo1.21 build -gcflags=\"-N -l\" main.go  // + matching delve version\n","handlingStrategy":"fallback","validationCode":"// Confirm runtime DWARF exposes abi.Itab fields before evaluating interfaces\n// search DWARF for struct internal/abi.Itab fields Type/_type","typeGuard":null,"tryCatchPattern":"v, err := dbg.EvalVariable(scope, \"myIface\", cfg)\nif err != nil && strings.Contains(fmt.Sprint(err), \"invalid interface type\") {\n    // upgrade delve / rebuild debuggee with supported Go version\n}","preventionTips":["Keep Delve version aligned with the Go toolchain used to build the debuggee","Never build debug binaries with -w (strips DWARF incl. runtime types)","Use standard Go releases, not heavily patched runtimes"],"tags":["delve","interface","runtime","dwarf"],"backgroundTag":"interface-type-unreadable","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}