{"record":{"id":"eeef509160b2855f","repo":"go-delve/delve","slug":"memory-range-at-x-of-size-x-is-past-the-end-of","errorCode":null,"errorMessage":"memory range at %#x of size %#x is past the end of file, while %s","messagePattern":"memory range at %#x of size %#x is past the end of file, while (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/core/minidump/minidump.go","lineNumber":614,"sourceCode":"\n// readMemory64List reads a _MINIDUMP_MEMORY64_LIST structure, containing\n// the description of the process memory.\n// See: https://docs.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_memory64_list\n// And: https://docs.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_memory_descriptor\nfunc readMemory64List(mdmp *Minidump, buf *minidumpBuf, logfn func(fmt string, args ...any)) {\n\trangesNum := buf.u64()\n\tbaseOff := int(buf.u64())\n\tif buf.err != nil {\n\t\treturn\n\t}\n\n\tfor i := range rangesNum {\n\t\taddr := buf.u64()\n\t\tsz := buf.u64()\n\n\t\tend := baseOff + int(sz)\n\t\tif baseOff >= len(buf.buf) || end > len(buf.buf) {\n\t\t\tbuf.err = fmt.Errorf(\"memory range at %#x of size %#x is past the end of file, while %s\", baseOff, sz, buf.ctx)\n\t\t\treturn\n\t\t}\n\n\t\tmdmp.addMemory(addr, buf.buf[baseOff:end])\n\n\t\tif logfn != nil {\n\t\t\tlogfn(\"\\tMemory %d addr:%#x size:%#x FileOffset:%#x\", i, addr, sz, baseOff)\n\t\t}\n\n\t\tbaseOff = end\n\t}\n}\n\nfunc readMemoryInfoList(mdmp *Minidump, buf *minidumpBuf, logfn func(fmt string, args ...any)) {\n\tstartOff := buf.off\n\tsizeOfHeader := int(buf.u32())\n\tsizeOfEntry := int(buf.u32())\n\tnumEntries := buf.u64()","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/core/minidump/minidump.go#L596-L632","documentation":"While reading a memory list stream, each entry gives a target address and a size, and the reader slices buf.buf[baseOff:baseOff+sz]. If that range lies outside the file, the dump is internally inconsistent and parsing stops with this error. It is the memory-range sibling of the location/string bounds checks and signals a truncated or corrupt minidump.","triggerScenarios":"proc.LoadMiniDumpFile parsing a MemoryListStream/Memory64ListStream where a range's start offset (baseOff) is at or beyond the file length, or baseOff+size exceeds it.","commonSituations":"Dumps truncated during collection (process died mid-MiniDumpWriteDump), uploads cut short, filesystem issues, or corrupted archives where the memory stream region was lost.","solutions":["Re-acquire the minidump and verify completeness (file size on producer vs consumer).","Inspect with dumpchk/WinDbg to see which memory ranges are missing.","Recopy or re-download the file; compare SHA-256 before and after transfer.","If dumps are routinely truncated, increase dump-writing timeout or write full dumps synchronously before the process exits."],"exampleFix":"// before\ncore, err := proc.LoadMiniDumpFile(\"cut.dmp\", nil, 0) // memory range at 0x3f0000 of size 0x1000 is past the end of file\n\n// after: check the transfer completed\nif got, want := sizeOf(\"cut.dmp\"), sizeOnServer(\"cut.dmp\"); got != want {\n    reDownload(\"cut.dmp\")\n}","handlingStrategy":"validation","validationCode":"func memoryRangesFit(path string) error {\n    buf, err := os.ReadFile(path)\n    if err != nil { return err }\n    // iterate Memory(List|64)Stream descriptors; each baseOff+sz must satisfy baseOff+sz <= len(buf)\n    return checkMemoryDescriptors(buf)\n}","typeGuard":null,"tryCatchPattern":"core, err := proc.LoadMiniDumpFile(path, logfn, 0)\nif err != nil {\n    if strings.Contains(err.Error(), \"memory range at\") {\n        return fmt.Errorf(\"dump %s is missing memory data (truncated); re-capture: %w\", path, err)\n    }\n    return err\n}","preventionTips":["Use synchronous full-dump capture and verify completion before shipping.","Monitor dump collector timeouts - partial dumps are the top cause of this error.","Keep a manifest of expected dump sizes and compare on receipt.","Fail fast in pipelines on size mismatch instead of attempting analysis."],"tags":["minidump","memory-range","corrupt-file","truncated"],"backgroundTag":"minidump-offset-past-eof","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}