{"record":{"id":"8ccbcbf78a5a805e","repo":"go-delve/delve","slug":"error-accessing-swiss-map-in-table-d-group-d-s","errorCode":null,"errorMessage":"error accessing swiss map in table %d, group %d, slot %d","messagePattern":"error accessing swiss map in table (.+?), group (.+?), slot (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/proc/mapiter.go","lineNumber":551,"sourceCode":"\t\t\tvar slotsLen uint32\n\t\t\tif it.mapsplitgroup {\n\t\t\t\tslotsLen = uint32(it.group.keys.Len)\n\t\t\t} else {\n\t\t\t\tslotsLen = uint32(it.group.slots.Len)\n\t\t\t}\n\t\t\tfor ; it.slotIdx < slotsLen; it.slotIdx++ {\n\t\t\t\tif it.slotIsEmptyOrDeleted(it.slotIdx) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvar err1, err2 error\n\t\t\t\tif it.mapsplitgroup {\n\t\t\t\t\tit.curKey, err1 = it.group.keys.sliceAccess(int(it.slotIdx))\n\t\t\t\t\tit.curValue, err2 = it.group.elems.sliceAccess(int(it.slotIdx))\n\t\t\t\t} else {\n\t\t\t\t\tcur, err := it.group.slots.sliceAccess(int(it.slotIdx))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tit.v.Unreadable = fmt.Errorf(\"error accessing swiss map in table %d, group %d, slot %d\", it.dirIdx, it.groupIdx, it.slotIdx)\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t\tit.curKey, err1 = cur.toField(it.slotFieldKey)\n\t\t\t\t\tit.curValue, err2 = cur.toField(it.slotFieldElem)\n\t\t\t\t}\n\t\t\t\tif err1 != nil || err2 != nil {\n\t\t\t\t\tit.v.Unreadable = fmt.Errorf(\"error accessing swiss map slot: %v %v\", err1, err2)\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// If the type we expect is non-pointer but we read a pointer type it\n\t\t\t\t// means that the key (or the value) is stored indirectly into the map\n\t\t\t\t// because it is too big. We dereference it here so that the type of the\n\t\t\t\t// key (or value) matches the type on the map definition.\n\t\t\t\tif it.curKey.Kind == reflect.Ptr && !it.keyTypeIsPtr {\n\t\t\t\t\tit.curKey = it.curKey.maybeDereference()\n\t\t\t\t}","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/mapiter.go#L533-L569","documentation":"When walking a Go swiss map (Go 1.24+ map implementation), the iterator fetches the key/value (or slot) at the current table/group/slot position. If that slice access cannot read memory, iteration stops and the Variable is marked Unreadable with a message identifying the exact table, group, and slot.","triggerScenarios":"Evaluating a swiss map whose group/slot memory is unreadable at the computed offsets — stale iterators across map growth, corrupted group pointers, or unreadable memory regions (e.g. missing core dump pages).","commonSituations":"Debugging programs built with Go 1.24+ swiss maps using an outdated delve; inspecting maps in core dumps with incomplete memory; holding Variable references across map mutations.","solutions":["Upgrade delve to a version matching the target's Go version (swiss map layout support)","Re-evaluate the map at the current stop point rather than reusing stale Variables","Verify core dump completeness or that the process memory is not corrupted"],"exampleFix":"// before\ndlv --version # delve predates Go 1.24 swiss maps\n// after\ngo install github.com/go-delve/delve/cmd/dlv@latest # matching Go 1.24+","handlingStrategy":"fallback","validationCode":"if v.Unreadable != nil {\n    return fmt.Errorf(\"map not readable: %v\", v.Unreadable)\n}\nif !isSwissMapRuntime(goVersion) {\n    return fmt.Errorf(\"upgrade delve for Go 1.24+ swiss maps\")\n}","typeGuard":"func isReadable(v *proc.Variable) bool {\n    return v.Unreadable == nil\n}","tryCatchPattern":"ok := iterateMap(it)\nif !ok && it.v.Unreadable != nil {\n    if strings.Contains(it.v.Unreadable.Error(), \"error accessing swiss map\") {\n        return reEvaluateAndIterate(mapExpr)\n    }\n    return it.v.Unreadable\n}","preventionTips":["Keep delve version in sync with the target Go version (swiss maps: Go 1.24+)","Avoid reusing map Variables across map mutations/resumes","Verify core files contain all mapped pages"],"tags":["go","maps","swissmap","variables"],"backgroundTag":"variable-unreadable-memory","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}