go-delve/delve · error

string starting at %#x of size %#x is past the end of file,

Error message

string starting at %#x of size %#x is past the end of file, while %s

What it means

When parsing a MINIDUMP_STRING, the reader reads a 4-byte length in bytes, then checks that buf.off+sz stays inside the file. If the UTF-16 string extends past the end of the file, parsing is aborted with this error. Like the memory-range variant, it indicates a truncated or corrupt dump whose string offsets no longer fit.

Source

Thrown at pkg/proc/core/minidump/minidump.go:518

	}
	end := off + int(sz)
	if off >= len(buf.buf) || end > len(buf.buf) {
		buf.err = fmt.Errorf("location starting at %#x of size %#x is past the end of file, while %s", off, sz, buf.ctx)
		return 0, nil
	}
	rawData = buf.buf[off:end]
	return
}

func readString(buf *minidumpBuf) string {
	startOff := buf.off
	sz := buf.u32()
	if buf.err != nil {
		return ""
	}
	end := buf.off + int(sz)
	if buf.off >= len(buf.buf) || end > len(buf.buf) {
		buf.err = fmt.Errorf("string starting at %#x of size %#x is past the end of file, while %s", startOff, sz, buf.ctx)
		return ""
	}
	return decodeUTF16(buf.buf[buf.off:end])
}

// readThreadList reads a thread list stream and adds the threads to the minidump.
func readThreadList(mdmp *Minidump, buf *minidumpBuf) {
	threadNum := buf.u32()
	if buf.err != nil {
		return
	}

	mdmp.Threads = make([]Thread, threadNum)

	for i := range mdmp.Threads {
		buf.ctx = fmt.Sprintf("reading thread list entry %d", i)
		thread := &mdmp.Threads[i]

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Obtain an intact copy of the minidump and verify its size/hash against the source machine.
  2. Validate the dump with WinDbg/dumpchk to pinpoint the corrupted stream.
  3. Re-capture the dump with a reliable method (procdump, Task Manager 'Create dump file') and confirm it finished.
  4. For untrusted dumps, pre-scan with a minidump library that validates string RVAs before loading.

Example fix

// before
_, err := proc.LoadMiniDumpFile("part.dmp", nil, 0) // string starting at 0x1a2b0 of size 0x1c is past the end of file

// after: transfer again and check integrity
sum, _ := hashFile("part.dmp")
if sum != expectedMD5 { reDownload("part.dmp") }
Defensive patterns

Strategy: validation

Validate before calling

// Pre-scan MINIDUMP_STRING RVAs with a lenient parser before loading:
func stringsWithinFile(path string) error {
    data, err := os.ReadFile(path)
    if err != nil { return err }
    // every RVA+size recorded in the dump must satisfy rva+size <= len(data)
    return validateAllStringRVAs(data)
}

Try / catch

_, err := proc.LoadMiniDumpFile(path, nil, 0)
if err != nil {
    if strings.Contains(err.Error(), "string starting at") {
        return fmt.Errorf("dump contains corrupt/truncated string data; obtain a fresh dump: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: proc.LoadMiniDumpFile encounters a MINIDUMP_STRING (module names, OS description in SystemInfoStream, etc.) whose declared byte size runs past EOF: buf.off >= len(buf.buf) or buf.off+sz > len(buf.buf).

Common situations: Partial file transfer, dump cut off while being written, corruption from email/zip transfer, or a faultily crafted dump with bogus string sizes.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/c92bd3374a13cc22. Report an issue: GitHub.