{"record":{"id":"6516e8bc565f6bfc","repo":"go-delve/delve","slug":"executables-built-by-go-1-11-or-later-need-delve-b","errorCode":null,"errorMessage":"executables built by Go 1.11 or later need Delve built by Go 1.11 or later","messagePattern":"executables built by Go 1\\.11 or later need Delve built by Go 1\\.11 or later","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/debugger/debugger.go","lineNumber":2512,"sourceCode":"\t\tif g == nil {\n\t\t\tg = &proc.G{Unreadable: err}\n\t\t}\n\t\tgs[i] = g\n\t}\n\treturn gs, nil\n}\n\nfunc go11DecodeErrorCheck(err error) error {\n\tif !errors.Is(err, dwarf.DecodeError{}) {\n\t\treturn err\n\t}\n\n\tgover, ok := goversion.Installed()\n\tif !ok || !gover.AfterOrEqual(goversion.GoVersion{Major: 1, Minor: 11, Rev: -1}) || goversion.VersionAfterOrEqual(runtime.Version(), 1, 11) {\n\t\treturn err\n\t}\n\n\treturn errors.New(\"executables built by Go 1.11 or later need Delve built by Go 1.11 or later\")\n}\n\nconst NoDebugWarning string = \"debuggee must not be built with 'go run' or -ldflags='-s -w', which strip debug info\"\n\nfunc noDebugErrorWarning(err error) error {\n\tif errors.Is(err, dwarf.DecodeError{}) || strings.Contains(err.Error(), \"could not open debug info\") {\n\t\treturn fmt.Errorf(\"%s - %s\", err.Error(), NoDebugWarning)\n\t}\n\treturn err\n}\n\nfunc verifyBinaryFormat(exePath string) (string, error) {\n\tfullpath, err := filepath.Abs(exePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tf, err := os.Open(fullpath)","sourceCodeStart":2494,"sourceCodeEnd":2530,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/debugger/debugger.go#L2494-L2530","documentation":"Delve must be compiled with a Go toolchain new enough to understand the debug info produced by the toolchain that built the debuggee. When loading the binary fails and Delve detects the executable was built by Go 1.11+ while the running Delve binary itself was built by an older Go (pre-1.11), it returns this explanatory error instead of the raw parse failure.","triggerScenarios":"noDebugErrorWarning / the helper at debugger.go:2512 receives an error while parsing the executable's debug info (dwarf.DecodeError or missing debug info) and goversion checks confirm: executable built with Go >= 1.11 but runtime.Version() of the Delve binary is < 1.11.","commonSituations":"Using a very old prebuilt dlv binary (built with Go 1.10 or earlier) against any modern Go program; distro-packaged delve versions pinned to ancient toolchains; environments where an old delve was vendored and never rebuilt.","solutions":["Rebuild or reinstall Delve with a current Go toolchain: `go install github.com/go-delve/delve/cmd/dlv@latest`","Download a prebuilt dlv release built with a recent Go version","Check `dlv version` output for its Go version and ensure it is >= the version used to build your program"],"exampleFix":"// before (shell)\ndlv version  # built with go1.10\ndlv debug .  # program built with go1.21 -> error\n// after\ngo install github.com/go-delve/delve/cmd/dlv@latest\ndlv debug .","handlingStrategy":"fallback","validationCode":"// shell precondition check\nif !strings.Contains(run(captureStderr, \"go\", \"version\"), goRuntimeVerOfDelve()) {\n    // warn: delve binary built with older Go than target\n}","typeGuard":"func delveToolchainNewEnough(dlvGoVer string, targetGoVer goversion.GoVersion) bool {\n    v, ok := goversion.Parse(dlvGoVer)\n    return ok && v.AfterOrEqual(targetGoVer)\n}","tryCatchPattern":"_, err := dbg.Launch(args, dir)\nif err != nil && strings.Contains(err.Error(), \"need Delve built by Go 1.11 or later\") {\n    // instruct user to reinstall dlv with a current toolchain\n}","preventionTips":["Keep delve updated (`go install github.com/go-delve/delve/cmd/dlv@latest`)","Run `dlv version` and compare its Go version with your project's toolchain in setup scripts","Avoid distro-pinned ancient delve builds for modern Go projects"],"tags":["version-compatibility","go-version","dwarf","toolchain"],"backgroundTag":"toolchain-version-mismatch","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}