go-delve/delve · error
could not read string pointer %s
Error message
could not read string pointer %s
What it means
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.
Source
Thrown at pkg/proc/variables.go:1547
var strlen int64
var outaddr uint64
var err error
for _, field := range typ.StructType.Field {
switch field.Name {
case "len":
strlen, err = readIntRaw(mem, addr+uint64(field.ByteOffset), int64(arch.PtrSize()))
if err != nil {
return 0, 0, fmt.Errorf("could not read string len %s", err)
}
if strlen < 0 {
return 0, 0, fmt.Errorf("invalid length: %d", strlen)
}
case "str":
outaddr, err = readUintRaw(mem, addr+uint64(field.ByteOffset), int64(arch.PtrSize()))
if err != nil {
return 0, 0, fmt.Errorf("could not read string pointer %s", err)
}
if addr == 0 {
return 0, 0, nil
}
}
}
return outaddr, strlen, nil
}
func readStringValue(mem MemoryReadWriter, addr uint64, strlen int64, cfg LoadConfig) (string, error) {
if strlen == 0 {
return "", nil
}
count := min(strlen, int64(cfg.MaxStringLen))
val := make([]byte, int(count))View on GitHub (pinned to a23773e6c3)
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.
Defensive patterns
Strategy: retry
Validate before calling
// (dlv) print str // (dlv) print str.len // if len is readable but str is not, the page is unmapped
Try / catch
if strings.Contains(err.Error(), "could not read string pointer") {
return retryAfterTargetStable(expr)
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- could not read string len %s
- could not read string at %#v due to %s
- parent pointer unreadable: %w
- invalid length: %d
- short read
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/16ced00da3138ec4.
Report an issue: GitHub.