{"record":{"id":"4974fcbc5c73e358","repo":"go-delve/delve","slug":"malformed-delve-header-note-bad-entry-point-v","errorCode":null,"errorMessage":"malformed delve header note (bad entry point): %v","messagePattern":"malformed delve header note \\(bad entry point\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/core/delve_core.go","lineNumber":53,"sourceCode":"\t\t\tfor {\n\t\t\t\tline, err := buf.ReadString('\\n')\n\t\t\t\tif err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif len(line) > 0 && line[len(line)-1] == '\\n' {\n\t\t\t\t\tline = line[:len(line)-1]\n\t\t\t\t}\n\t\t\t\tswitch {\n\t\t\t\tcase strings.HasPrefix(line, elfwriter.DelveHeaderTargetPidPrefix):\n\t\t\t\t\tpid, err := strconv.ParseUint(line[len(elfwriter.DelveHeaderTargetPidPrefix):], 10, 64)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"malformed delve header note (bad pid): %v\", err)\n\t\t\t\t\t}\n\t\t\t\t\tp.pid = int(pid)\n\t\t\t\tcase strings.HasPrefix(line, elfwriter.DelveHeaderEntryPointPrefix):\n\t\t\t\t\tentry, err := strconv.ParseUint(line[len(elfwriter.DelveHeaderEntryPointPrefix):], 0, 64)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"malformed delve header note (bad entry point): %v\", err)\n\t\t\t\t\t}\n\t\t\t\t\tp.entryPoint = entry\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif note.Type != elfwriter.DelveThreadNodeType {\n\t\t\tcontinue\n\t\t}\n\t\tbody := bytes.NewReader(note.Desc.([]byte))\n\t\tth := new(delveThread)\n\t\tth.regs = new(delveRegisters)\n\n\t\tvar readerr error\n\t\tread := func(out any) {\n\t\t\tif readerr != nil {\n\t\t\t\treturn\n\t\t\t}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/core/delve_core.go#L35-L71","documentation":"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.","triggerScenarios":"readLinuxOrPlatformIndependentCore -> threadsFromDelveNotes reads a DelveHeaderEntryPointPrefix line whose value (after the prefix) is not a valid integer in base 0, e.g. 'entry point: xyz'.","commonSituations":"Corrupted or truncated note payload; a third-party core writer emitting a symbolic address instead of a literal; manual edits introducing stray characters.","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."],"exampleFix":"// before\n\"entry point: main.main\" // symbolic not accepted\n// after\n\"entry point: 0x401000\" // hex (base 0) or decimal","handlingStrategy":"validation","validationCode":"// Validate entry point line before parsing (base 0 allows 0x hex)\nentryStr := strings.TrimPrefix(line, DelveHeaderEntryPointPrefix)\nif _, err := strconv.ParseUint(entryStr, 0, 64); err != nil {\n\treturn fmt.Errorf(\"core note entry point %q is not a number\", entryStr)\n}","typeGuard":"func isIntegerBase0(s string) bool {\n\t_, err := strconv.ParseUint(s, 0, 64)\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["core-dump","elf-notes","parse-error"],"backgroundTag":"malformed-core-header-note","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}