go-delve/delve · critical
unsupported operating system
Error message
unsupported operating system
What it means
loadBinaryInfo dispatches on runtime.GOOS (elf/PE/Macho loaders) and returns this error for any operating system it has no loader for. It means Delve's proc package cannot parse executables on the current platform at all, so BinaryInfo loading fails before any debugging can start.
Source
Thrown at pkg/proc/bininfo.go:918
bi.DebugInfoDirectories = debugInfoDirs
return bi.AddImage(path, entryPoint)
}
func loadBinaryInfo(bi *BinaryInfo, image *Image, path string, entryPoint uint64) error {
var wg sync.WaitGroup
defer wg.Wait()
switch bi.GOOS {
case "linux", "freebsd":
return loadBinaryInfoElf(bi, image, path, entryPoint, &wg)
case "windows":
return loadBinaryInfoPE(bi, image, path, entryPoint, &wg)
case "darwin":
return loadBinaryInfoMacho(bi, image, path, entryPoint, &wg)
}
return errors.New("unsupported operating system")
}
// GStructOffset returns the offset of the G
// struct in thread local storage.
func (bi *BinaryInfo) GStructOffset(mem MemoryReadWriter) (uint64, error) {
offset := bi.gStructOffset
if bi.gStructOffsetIsPtr {
// The G struct offset from the TLS section is a pointer
// and the address must be dereferenced to find to actual G struct offset.
var err error
offset, err = readUintRaw(mem, offset, int64(bi.Arch.PtrSize()))
if err != nil {
return 0, err
}
}
return offset, nil
}
View on GitHub (pinned to a23773e6c3)
Solutions
- Build/run Delve on a supported OS: linux, windows, or darwin
- Check `dlv --version` / the binary's target platform matches the host
- For remote debugging, run dlv headless on a supported machine and connect with dlv connect
- If adding a new platform, add a loadBinaryInfo<Format> case in loadBinaryInfo plus a port per Documentation/internal/portnotes.md
Defensive patterns
Strategy: validation
Validate before calling
switch runtime.GOOS {
case "linux", "windows", "darwin":
// supported
default:
return fmt.Errorf("delve does not support executables on %s", runtime.GOOS)
} Try / catch
if err := loadErr; err != nil {
if err.Error() == "unsupported operating system" {
// fail fast: cannot debug on this platform; use remote dlv on supported host
}
} Prevention
- Verify the dlv binary was built for the host GOOS
- Use dlv headless + dlv connect for cross-platform workflows
- Consult the porting notes before embedding pkg/proc on new OSes
When it happens
Trigger: Running a Delve binary (or embedding pkg/proc) on an OS other than linux, windows, or darwin — e.g. freebsd builds where this generic path is reached, or cross-compiled binaries reporting an unexpected runtime.GOOS.
Common situations: Embedding delve as a library on an unsupported platform; running an incorrectly cross-compiled dlv binary; exotic GOOS values (plan9, js, illumos).
Related errors
- ErrCouldNotDetermineRelocation
- ErrNoDebugInfoFound
- malformed executable
- can't open separate debug file:
- unsupported machine type
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/51c149e50728496d.
Report an issue: GitHub.