go-delve/delve · error
error loading module data: %v
Error message
error loading module data: %v
What it means
After obtaining an interface's runtime type (*_type), Delve loads the runtime's moduledata (needed to map runtime types back to DWARF compile units via type offsets). Any failure reading or parsing moduledata marks the interface unreadable.
Source
Thrown at pkg/proc/variables.go:2126
if isnil {
// interface to nil
data = data.maybeDereference()
v.Children = []Variable{*data}
if loadData {
v.Children[0].loadValueInternal(recurseLevel, cfg)
}
return
}
if data == nil {
v.Unreadable = errors.New("invalid interface type")
return
}
mds, err := _type.bi.getModuleData(_type.mem)
if err != nil {
v.Unreadable = fmt.Errorf("error loading module data: %v", err)
return
}
typ, directIface, err := RuntimeTypeToDIE(_type, data.Addr, mds)
if err != nil {
v.Unreadable = err
return
}
deref := false
if !directIface {
realtyp := godwarf.ResolveTypedef(typ)
if _, isptr := realtyp.(*godwarf.PtrType); !isptr {
typ = pointerTo(typ, v.bi.Arch)
deref = true
}
}
View on GitHub (pinned to a23773e6c3)
Solutions
- Rebuild with standard 'go build' and default buildmode so firstmoduledata is present and standard-shaped
- Upgrade Delve if the debuggee uses a newer Go runtime with changed moduledata layout
- For core dumps, ensure the core captured the data segment containing moduledata (full core)
- Check the binary wasn't post-processed (stripped/packed) in ways that removed or moved moduledata symbols
Defensive patterns
Strategy: fallback
Validate before calling
// Verify firstmoduledata is present and readable
md, err := bi.getModuleData(mem)
if err != nil { /* interface concrete-type resolution unavailable */ } Try / catch
if v, err := dbg.EvalVariable(scope, expr, cfg); err != nil || v.Unreadable != nil {
// fall back to printing raw interface fields (tab/data words)
} Prevention
- Avoid exotic buildmodes (c-archive, plugin) when you need full introspection
- Ensure cores include the data segment holding moduledata
- Upgrade Delve for newer Go runtimes with changed moduledata layout
When it happens
Trigger: Printing an interface whose concrete type resolution requires getModuleData, when the moduledata memory is unreadable, the firstmoduledata symbol is missing from the binary, or the moduledata contents fail validation.
Common situations: Debugging binaries built with unusual linkers (external linking plugins, -buildmode=c-archive) where moduledata layout/symbols differ; core dumps missing the pages holding moduledata; Go version mismatches.
Related errors
- invalid interface type: %v
- short read
- can not continue execution of core process
- can not change register values of core process
- unrecognized core format
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/45e841a89d31d913.
Report an issue: GitHub.