{"record":{"id":"a35d5c6f199ea3a6","repo":"go-delve/delve","slug":"unrecognized-core-format","errorCode":null,"errorMessage":"unrecognized core format","messagePattern":"unrecognized core format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/core/core.go","lineNumber":202,"sourceCode":"\tErrWriteCore = errors.New(\"can not write to core process\")\n\n\t// ErrShortRead is returned on a short read.\n\tErrShortRead = errors.New(\"short read\")\n\n\t// ErrContinueCore is returned when trying to continue execution of a core process.\n\tErrContinueCore = errors.New(\"can not continue execution of core process\")\n\n\t// ErrChangeRegisterCore is returned when trying to change register values for core files.\n\tErrChangeRegisterCore = errors.New(\"can not change register values of core process\")\n)\n\ntype openFn func(string, string) (*process, proc.Thread, error)\n\nvar openFns = []openFn{readLinuxOrPlatformIndependentCore, readAMD64Minidump}\n\n// ErrUnrecognizedFormat is returned when the core file is not recognized as\n// any of the supported formats.\nvar ErrUnrecognizedFormat = errors.New(\"unrecognized core format\")\n\n// OpenCore will open the core file and return a *proc.TargetGroup.\n// If the DWARF information cannot be found in the binary, Delve will look\n// for external debug files in the directories passed in.\nfunc OpenCore(corePath, exePath string, debugInfoDirs []string) (*proc.TargetGroup, error) {\n\tvar p *process\n\tvar currentThread proc.Thread\n\tvar err error\n\tfor _, openFn := range openFns {\n\t\tp, currentThread, err = openFn(corePath, exePath)\n\t\tif err != ErrUnrecognizedFormat {\n\t\t\tbreak\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/core/core.go#L184-L220","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check you passed the core file, not the executable, and that the file exists and is non-empty (file core → 'ELF core file').","Confirm the core was produced on a supported OS/architecture (Linux ELF core, or supported amd64 minidump).","Re-generate the dump (gcore, ulimit -c unlimited, or delve dump) and verify integrity (e.g. checksums on transfer).","If format is exotic, convert it with gdb (gdb -c core, then gcore) into a standard Linux ELF core."],"exampleFix":"// before\ndlv core ./myapp          # wrong: executable passed as core\n\n// after\ndlv core ./core.1234 ./myapp   # core path first, executable second","handlingStrategy":"validation","validationCode":"f, err := os.Open(corePath); defer f.Close()\nmagic := make([]byte, 4); io.ReadFull(f, magic)\nif !bytes.Equal(magic, []byte{0x7f, 'E', 'L', 'F'}) {\n    return fmt.Errorf(\"%s is not an ELF core file\", corePath)\n}","typeGuard":"func isELF(path string) bool {\n    b, err := os.ReadFile(path); if err != nil || len(b) < 4 { return false }\n    return b[0] == 0x7f && string(b[1:4]) == \"ELF\"\n}","tryCatchPattern":"tg, err := core.OpenCore(corePath, exePath, dirs)\nif errors.Is(err, core.ErrUnrecognizedFormat) {\n    return fmt.Errorf(\"%s is not a supported core format (need Linux ELF core or supported minidump)\", corePath)\n}","preventionTips":["Never swap the core and executable arguments to OpenCore/dlv core.","Validate the core with 'file core' (expect 'ELF core file') before opening.","Verify checksums of cores downloaded from remote machines.","Only collect cores in supported formats (Linux ELF core; supported minidumps)."],"tags":["core-dump","file-format","go","delve"],"backgroundTag":"unrecognized-file-format","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}