{"record":{"id":"44661a929225dc3e","repo":"go-delve/delve","slug":"reading-desc-v","errorCode":null,"errorMessage":"reading desc: %v","messagePattern":"reading desc: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/core/linux_core.go","lineNumber":321,"sourceCode":"\thdr := &elfNotesHdr{}\n\n\terr := binary.Read(r, binary.LittleEndian, hdr)\n\tif err != nil {\n\t\treturn nil, err // don't wrap so readNotes sees EOF.\n\t}\n\tnote.Type = elf.NType(hdr.Type)\n\n\tname := make([]byte, hdr.Namesz)\n\tif _, err := r.Read(name); err != nil {\n\t\treturn nil, fmt.Errorf(\"reading name: %v\", err)\n\t}\n\tnote.Name = string(name)\n\tif err := skipPadding(r, 4); err != nil {\n\t\treturn nil, fmt.Errorf(\"aligning after name: %v\", err)\n\t}\n\tdesc := make([]byte, hdr.Descsz)\n\tif _, err := r.Read(desc); err != nil {\n\t\treturn nil, fmt.Errorf(\"reading desc: %v\", err)\n\t}\n\tdescReader := bytes.NewReader(desc)\n\tswitch note.Type {\n\tcase elf.NT_PRSTATUS:\n\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)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/core/linux_core.go#L303-L339","documentation":"readNote wraps a failed read of the note descriptor (hdr.Descsz bytes) with this message. The descriptor holds the actual note payload (registers, process info, etc.), so when it cannot be read the whole note and thus the core file is unusable. Delve surfaces the underlying reader error wrapped in this context.","triggerScenarios":"The core file ends after the note header/name/padding but before Descsz descriptor bytes, or the underlying reader (r.Read) returns an I/O error while reading the descriptor during dlv core parsing.","commonSituations":"Truncated core dumps from ulimit -c, disk-full during dump generation, interrupted file transfers, or a corrupted core file downloaded from a CI artifact store.","solutions":["Verify the core file size is complete and re-dump with an adequate ulimit -c (ulimit -c unlimited).","Re-transfer the core file and compare checksums with the source.","Validate the core with readelf -n <core>; if it fails, the file is corrupt — regenerate it.","Free disk space / check mount health if the dump was written on a full or failing volume."],"exampleFix":"// before\ncmd := exec.Command(\"dlv\", \"core\", binary, \"core\")\ncmd.Run()\n// after\nif fi, err := os.Stat(corePath); err == nil && fi.Size() < minExpectedCoreSize {\n    return fmt.Errorf(\"core file %s truncated (%d bytes), re-dump with ulimit -c unlimited\", corePath, fi.Size())\n}","handlingStrategy":"validation","validationCode":"// Confirm the core is complete and its notes parse with an external tool before Delve:\ncmd := exec.Command(\"readelf\", \"-n\", corePath)\nif out, err := cmd.CombinedOutput(); err != nil {\n    return fmt.Errorf(\"core file %s has invalid notes: %v (%s)\", corePath, err, out)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Capture cores with gcore or the kernel, not custom partial dumpers.","Keep enough free disk space for full-memory cores.","Verify file sizes after rsync/scp of large cores.","Never open a core while its producer is still writing it."],"tags":["core-dump","elf","io","truncated-file"],"backgroundTag":"truncated-core-file","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}