go-delve/delve · error

unrecognized core format

Error message

unrecognized core format

What it means

ErrUnrecognizedFormat (pkg/proc/core/core.go:202) is returned when OpenCore (and each registered openFn: readLinuxOrPlatformIndependentCore, readAMD64Minidump) cannot identify the file as any supported core format. OpenCore tries every registered reader in order; if all fail with this error, the file is not a Linux ELF core nor a supported minidump.

Source

Thrown at pkg/proc/core/core.go:202

	ErrWriteCore = errors.New("can not write to core process")

	// ErrShortRead is returned on a short read.
	ErrShortRead = errors.New("short read")

	// ErrContinueCore is returned when trying to continue execution of a core process.
	ErrContinueCore = errors.New("can not continue execution of core process")

	// ErrChangeRegisterCore is returned when trying to change register values for core files.
	ErrChangeRegisterCore = errors.New("can not change register values of core process")
)

type openFn func(string, string) (*process, proc.Thread, error)

var openFns = []openFn{readLinuxOrPlatformIndependentCore, readAMD64Minidump}

// ErrUnrecognizedFormat is returned when the core file is not recognized as
// any of the supported formats.
var ErrUnrecognizedFormat = errors.New("unrecognized core format")

// OpenCore will open the core file and return a *proc.TargetGroup.
// If the DWARF information cannot be found in the binary, Delve will look
// for external debug files in the directories passed in.
func OpenCore(corePath, exePath string, debugInfoDirs []string) (*proc.TargetGroup, error) {
	var p *process
	var currentThread proc.Thread
	var err error
	for _, openFn := range openFns {
		p, currentThread, err = openFn(corePath, exePath)
		if err != ErrUnrecognizedFormat {
			break
		}
	}
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Check you passed the core file, not the executable, and that the file exists and is non-empty (file core → 'ELF core file').
  2. Confirm the core was produced on a supported OS/architecture (Linux ELF core, or supported amd64 minidump).
  3. Re-generate the dump (gcore, ulimit -c unlimited, or delve dump) and verify integrity (e.g. checksums on transfer).
  4. If format is exotic, convert it with gdb (gdb -c core, then gcore) into a standard Linux ELF core.

Example fix

// before
dlv core ./myapp          # wrong: executable passed as core

// after
dlv core ./core.1234 ./myapp   # core path first, executable second
Defensive patterns

Strategy: validation

Validate before calling

f, err := os.Open(corePath); defer f.Close()
magic := make([]byte, 4); io.ReadFull(f, magic)
if !bytes.Equal(magic, []byte{0x7f, 'E', 'L', 'F'}) {
    return fmt.Errorf("%s is not an ELF core file", corePath)
}

Type guard

func isELF(path string) bool {
    b, err := os.ReadFile(path); if err != nil || len(b) < 4 { return false }
    return b[0] == 0x7f && string(b[1:4]) == "ELF"
}

Try / catch

tg, err := core.OpenCore(corePath, exePath, dirs)
if errors.Is(err, core.ErrUnrecognizedFormat) {
    return fmt.Errorf("%s is not a supported core format (need Linux ELF core or supported minidump)", corePath)
}

Prevention

When it happens

Trigger: Calling OpenCore (or 'dlv core <path>') with a file that is not an ELF core dump: a text log, an ELF executable passed instead of the core, a Windows/unsupported minidump flavor, or a truncated/corrupted core whose magic or notes are missing.

Common situations: Swapping core and binary paths by mistake (dlv core app instead of dlv core core-file); downloading cores from a different OS (Windows minidumps); cores produced by non-Go tooling in unsupported formats; cloud storage truncation.

Related errors


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