go-delve/delve · error
could not load swiss map group slots: %v
Error message
could not load swiss map group slots: %v
What it means
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.
Source
Thrown at pkg/proc/mapiter.go:694
it.v.Unreadable = err
return
}
if it.mapsplitgroup {
g.keys, err2 = group.toField(it.groupFieldKeys)
if err2 != nil {
it.v.Unreadable = fmt.Errorf("could not load swiss map group keys: %v", err2)
return
}
g.elems, err2 = group.toField(it.groupFieldElems)
if err2 != nil {
it.v.Unreadable = fmt.Errorf("could not load swiss map group elems: %v", err2)
return
}
} else {
g.slots, err2 = group.toField(it.groupFieldSlots)
if err2 != nil {
it.v.Unreadable = fmt.Errorf("could not load swiss map group slots: %v", err2)
return
}
}
it.group = g
}
func (it *mapIteratorSwiss) key() *Variable {
return it.curKey
}
func (it *mapIteratorSwiss) value() *Variable {
return it.curValue
}
func (it *mapIteratorSwiss) slotIsEmptyOrDeleted(k uint32) bool {
// TODO: check that this hasn't changed after it's merged and the TODO is deleted
return it.group.ctrls[k]&swissTableCtrlEmpty == swissTableCtrlEmptyView on GitHub (pinned to a23773e6c3)
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
Example fix
// before go build -trimpath -ldflags="-s -w" -o app . // after go build -gcflags="-N -l" -o app .
Defensive patterns
Strategy: type-guard
Validate before calling
if v.Unreadable != nil { return } // slots field unresolvable; swiss map layout mismatch Type guard
func inspectableMap(v *proc.Variable) bool { return v != nil && v.Unreadable == nil && v.Kind == reflect.Map } Try / catch
if v.Unreadable != nil { return nil, fmt.Errorf("map unreadable: %w", v.Unreadable) } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- could not load swiss table index: %v
- could not load swiss table groups field: %v
- could not load swiss table groups data: %v
- could not load swiss table groups lengthMask field: %v
- could not load swiss table group lengthMask: %v
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/23d33afd5c3c28a7.
Report an issue: GitHub.