{"record":{"id":"23d33afd5c3c28a7","repo":"go-delve/delve","slug":"could-not-load-swiss-map-group-slots-v","errorCode":null,"errorMessage":"could not load swiss map group slots: %v","messagePattern":"could not load swiss map group slots: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/mapiter.go","lineNumber":694,"sourceCode":"\t\tit.v.Unreadable = err\n\t\treturn\n\t}\n\n\tif it.mapsplitgroup {\n\t\tg.keys, err2 = group.toField(it.groupFieldKeys)\n\t\tif err2 != nil {\n\t\t\tit.v.Unreadable = fmt.Errorf(\"could not load swiss map group keys: %v\", err2)\n\t\t\treturn\n\t\t}\n\t\tg.elems, err2 = group.toField(it.groupFieldElems)\n\t\tif err2 != nil {\n\t\t\tit.v.Unreadable = fmt.Errorf(\"could not load swiss map group elems: %v\", err2)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tg.slots, err2 = group.toField(it.groupFieldSlots)\n\t\tif err2 != nil {\n\t\t\tit.v.Unreadable = fmt.Errorf(\"could not load swiss map group slots: %v\", err2)\n\t\t\treturn\n\t\t}\n\t}\n\n\tit.group = g\n}\n\nfunc (it *mapIteratorSwiss) key() *Variable {\n\treturn it.curKey\n}\n\nfunc (it *mapIteratorSwiss) value() *Variable {\n\treturn it.curValue\n}\n\nfunc (it *mapIteratorSwiss) slotIsEmptyOrDeleted(k uint32) bool {\n\t// TODO: check that this hasn't changed after it's merged and the TODO is deleted\n\treturn it.group.ctrls[k]&swissTableCtrlEmpty == swissTableCtrlEmpty","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/mapiter.go#L676-L712","documentation":"Set on a map Variable by loadCurrentGroup when, in the combined-slot representation (non split-group), the 'slots' array field of the group cannot be resolved from DWARF. Delve throws it because keys and values live inside slot structs in this layout, and iteration cannot proceed without the slots field.","triggerScenarios":"Iterating a swiss map where groups store combined key/elem slots and group.toField(it.groupFieldSlots) fails because the group type in the debug info has no 'slots' field or it can't be read.","commonSituations":"Go runtime layout changed across releases; Delve version older than the target's Go version; DWARF damaged by -w -s, strip, or obfuscation tools (e.g. garble).","solutions":["Upgrade Delve to match the target's Go version","Rebuild the target binary with complete DWARF and no post-link stripping/obfuscation","Confirm Go version compatibility in Delve's supported-versions documentation","Temporarily expose map data through a slice for debugging"],"exampleFix":"// before\ngo build -trimpath -ldflags=\"-s -w\" -o app .\n// after\ngo build -gcflags=\"-N -l\" -o app .","handlingStrategy":"type-guard","validationCode":"if v.Unreadable != nil { return } // slots field unresolvable; swiss map layout mismatch","typeGuard":"func inspectableMap(v *proc.Variable) bool { return v != nil && v.Unreadable == nil && v.Kind == reflect.Map }","tryCatchPattern":"if v.Unreadable != nil { return nil, fmt.Errorf(\"map unreadable: %w\", v.Unreadable) }","preventionTips":["Use matching Delve/Go versions before debugging swiss map heavy code","Build debug binaries with full symbols and no obfuscation","Validate map inspection on a small test program after toolchain changes","Never assume iteration succeeded; check Unreadable and partial results"],"tags":["go","debugger","dwarf","swiss-map"],"backgroundTag":"swiss-map-layout-mismatch","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}