{"record":{"id":"9783c4ab788a344a","repo":"go-delve/delve","slug":"reading-nt-prpsinfo-v","errorCode":null,"errorMessage":"reading NT_PRPSINFO: %v","messagePattern":"reading NT_PRPSINFO: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/core/linux_core.go","lineNumber":344,"sourceCode":"\t\tswitch machineType {\n\t\tcase _EM_X86_64:\n\t\t\tnote.Desc = &linuxPrStatusAMD64{}\n\t\tcase _EM_AARCH64:\n\t\t\tnote.Desc = &linuxPrStatusARM64{}\n\t\tcase _EM_RISCV:\n\t\t\tnote.Desc = &linuxPrStatusRISCV64{}\n\t\tcase _EM_LOONGARCH:\n\t\t\tnote.Desc = &linuxPrStatusLOONG64{}\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"unsupported machine type\")\n\t\t}\n\t\tif err := binary.Read(descReader, binary.LittleEndian, note.Desc); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading NT_PRSTATUS: %v\", err)\n\t\t}\n\tcase elf.NT_PRPSINFO:\n\t\tnote.Desc = &linuxPrPsInfo{}\n\t\tif err := binary.Read(descReader, binary.LittleEndian, note.Desc); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading NT_PRPSINFO: %v\", err)\n\t\t}\n\tcase _NT_FILE:\n\t\t// No good documentation reference, but the structure is\n\t\t// simply a header, including entry count, followed by that\n\t\t// many entries, and then the file name of each entry,\n\t\t// null-delimited. Not reading the names here.\n\t\tdata := &linuxNTFile{}\n\t\tif err := binary.Read(descReader, binary.LittleEndian, &data.linuxNTFileHdr); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading NT_FILE header: %v\", err)\n\t\t}\n\t\tfor i := 0; i < int(data.Count); i++ {\n\t\t\tentry := &linuxNTFileEntry{}\n\t\t\tif err := binary.Read(descReader, binary.LittleEndian, entry); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"reading NT_FILE entry %v: %v\", i, err)\n\t\t\t}\n\t\t\tdata.entries = append(data.entries, entry)\n\t\t}\n\t\tnote.Desc = data","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/core/linux_core.go#L326-L362","documentation":"readNote wraps a binary.Read failure when decoding the NT_PRPSINFO descriptor into linuxPrPsInfo (process name, PID, UID, etc.). This means the descriptor bytes don't fill the expected struct — typically a truncated or corrupted core file. Delve needs PRPSINFO for process-level information during core debugging.","triggerScenarios":"The core file's NT_PRPSINFO note descriptor is shorter than sizeof(linuxPrPsInfo), or the underlying bytes.Reader errors, while Delve parses the core's NOTES segment.","commonSituations":"Truncated core dumps (ulimit -c, disk-full), cores from very old kernels whose prpsinfo layout differs from the modern struct Delve expects, or corrupted CI artifacts.","solutions":["Re-dump the core with sufficient limits (ulimit -c unlimited) and adequate disk space.","Validate with readelf -n <core> to confirm the NT_PRPSINFO note is intact.","Check kernel version compatibility if the core comes from an unusually old kernel.","Regenerate the core on the same machine/architecture as the crashing process."],"exampleFix":"// before\ndlv core ./app core.dmp // truncated, fails\n// after\nulimit -c unlimited\n./app // crash again\ncorectl validate core.dmp && dlv core ./app core.dmp","handlingStrategy":"validation","validationCode":"// Pre-flight: ask readelf to decode notes; a corrupt PRPSINFO fails there first:\nif err := exec.Command(\"readelf\", \"-n\", corePath).Run(); err != nil {\n    return fmt.Errorf(\"core %s failed note validation, re-dump before debugging\", corePath)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate cores rather than repairing them; PRPSINFO corruption means the whole dump is suspect.","Ensure the producing kernel is modern enough for standard prpsinfo layout.","Store cores on reliable volumes; fsync before use in CI.","Compare artifact checksums between producer and consumer machines."],"tags":["core-dump","elf","binary-decoding"],"backgroundTag":"core-note-decode-failed","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}