{"record":{"id":"16ced00da3138ec4","repo":"go-delve/delve","slug":"could-not-read-string-pointer-s","errorCode":null,"errorMessage":"could not read string pointer %s","messagePattern":"could not read string pointer (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/variables.go","lineNumber":1547,"sourceCode":"\n\tvar strlen int64\n\tvar outaddr uint64\n\tvar err error\n\n\tfor _, field := range typ.StructType.Field {\n\t\tswitch field.Name {\n\t\tcase \"len\":\n\t\t\tstrlen, err = readIntRaw(mem, addr+uint64(field.ByteOffset), int64(arch.PtrSize()))\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"could not read string len %s\", err)\n\t\t\t}\n\t\t\tif strlen < 0 {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"invalid length: %d\", strlen)\n\t\t\t}\n\t\tcase \"str\":\n\t\t\toutaddr, err = readUintRaw(mem, addr+uint64(field.ByteOffset), int64(arch.PtrSize()))\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"could not read string pointer %s\", err)\n\t\t\t}\n\t\t\tif addr == 0 {\n\t\t\t\treturn 0, 0, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn outaddr, strlen, nil\n}\n\nfunc readStringValue(mem MemoryReadWriter, addr uint64, strlen int64, cfg LoadConfig) (string, error) {\n\tif strlen == 0 {\n\t\treturn \"\", nil\n\t}\n\n\tcount := min(strlen, int64(cfg.MaxStringLen))\n\n\tval := make([]byte, int(count))","sourceCodeStart":1529,"sourceCodeEnd":1565,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/variables.go#L1529-L1565","documentation":"While loading a string header, Delve could not read the `str` (data pointer) field from target memory via `readUintRaw`. The memory-read error is embedded in the message. Without the data pointer the string's bytes cannot be fetched.","triggerScenarios":"Evaluating a string variable or field when the pointer-size read at the `str` field's byte offset fails, e.g. the header address is invalid or the page is unmapped.","commonSituations":"Same contexts as len-read failures: incomplete core dumps, remote sessions dropping, stale frame addresses; also happens when the string lives on a page not captured in the dump.","solutions":["Check the embedded cause (%s) for the actual memory error.","Print the enclosing struct to verify the header address is sane.","Re-dump core with complete memory or debug the live process.","Re-evaluate after the target state is consistent."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// (dlv) print str\n// (dlv) print str.len   // if len is readable but str is not, the page is unmapped","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"could not read string pointer\") {\n    return retryAfterTargetStable(expr)\n}","preventionTips":["Check the embedded memory error for the true cause.","Ensure core dumps include the pages holding string headers.","Re-evaluate once the process is fully halted."],"tags":["debugger","go","string","memory-read"],"backgroundTag":"string-header-unreadable","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}