go-delve/delve · error
malformed delve header note (bad entry point): %v
Error message
malformed delve header note (bad entry point): %v
What it means
In threadsFromDelveNotes the entry-point line of the delve header note must parse as a number; it is parsed with strconv.ParseUint using base 0 so 0x-prefixed hex is accepted. Any other malformed value produces this error.
Source
Thrown at pkg/proc/core/delve_core.go:53
for {
line, err := buf.ReadString('\n')
if err != nil {
break
}
if len(line) > 0 && line[len(line)-1] == '\n' {
line = line[:len(line)-1]
}
switch {
case strings.HasPrefix(line, elfwriter.DelveHeaderTargetPidPrefix):
pid, err := strconv.ParseUint(line[len(elfwriter.DelveHeaderTargetPidPrefix):], 10, 64)
if err != nil {
return nil, fmt.Errorf("malformed delve header note (bad pid): %v", err)
}
p.pid = int(pid)
case strings.HasPrefix(line, elfwriter.DelveHeaderEntryPointPrefix):
entry, err := strconv.ParseUint(line[len(elfwriter.DelveHeaderEntryPointPrefix):], 0, 64)
if err != nil {
return nil, fmt.Errorf("malformed delve header note (bad entry point): %v", err)
}
p.entryPoint = entry
}
}
}
if note.Type != elfwriter.DelveThreadNodeType {
continue
}
body := bytes.NewReader(note.Desc.([]byte))
th := new(delveThread)
th.regs = new(delveRegisters)
var readerr error
read := func(out any) {
if readerr != nil {
return
}View on GitHub (pinned to a23773e6c3)
Solutions
- Ensure the entry-point line contains a valid number (decimal or 0x-prefixed hex).
- Regenerate the core file with the same delve version that will read it.
- Check the note for truncation and re-dump if bytes are missing.
- If editing notes manually, validate with strconv.ParseUint(value, 0, 64) first.
Example fix
// before "entry point: main.main" // symbolic not accepted // after "entry point: 0x401000" // hex (base 0) or decimal
Defensive patterns
Strategy: validation
Validate before calling
// Validate entry point line before parsing (base 0 allows 0x hex)
entryStr := strings.TrimPrefix(line, DelveHeaderEntryPointPrefix)
if _, err := strconv.ParseUint(entryStr, 0, 64); err != nil {
return fmt.Errorf("core note entry point %q is not a number", entryStr)
} Type guard
func isIntegerBase0(s string) bool {
_, err := strconv.ParseUint(s, 0, 64)
return err == nil
} Prevention
- Write entry points as decimal or 0x-prefixed hex only.
- Do not emit symbolic addresses into notes.
- Regenerate cores rather than patching bytes.
- Verify note bytes round-trip through the reader.
When it happens
Trigger: readLinuxOrPlatformIndependentCore -> threadsFromDelveNotes reads a DelveHeaderEntryPointPrefix line whose value (after the prefix) is not a valid integer in base 0, e.g. 'entry point: xyz'.
Common situations: Corrupted or truncated note payload; a third-party core writer emitting a symbolic address instead of a literal; manual edits introducing stray characters.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- malformed delve header note (bad pid): %v
- malformed delve header note: %q
- reading name: %v
- short read
- can not continue execution of core process
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/4974fcbc5c73e358.
Report an issue: GitHub.