go-delve/delve · error

emulation exception

Error message

emulation exception

What it means

machTargetExcToError maps Mach exception 0x94 (EXC_EMULATION) to 'emulation exception', meaning an instruction required emulator assistance that failed (equivalent of SIGEMUL).

Solutions

  1. Check whether you're running under Rosetta or another translation layer and test a native build.
  2. Disassemble at PC to identify the faulting instruction.
  3. Rebuild/upgrade dependencies that may emit obsolete instructions.
  4. If persistent, report to delve/Apple with the wire log and disassembly.
Defensive patterns

Strategy: try-catch

Try / catch

if err != nil && strings.Contains(err.Error(), "emulation exception") {
    // check for translation-layer (Rosetta) issues
}

Prevention

When it happens

Trigger: Target triggers an emulation fault on macOS; the stub reports Mach exception 0x94 and delve converts it into this error.

Common situations: Rare; seen with unusual instructions, binary translation layers (Rosetta), or kernels failing to emulate a legacy instruction.

Related errors


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

Appendix: source

Thrown at pkg/proc/gdbserial/gdbserver.go:2231

	copy(savedRegs.loaded, regs.loaded)
	return savedRegs, nil
}

func registerName(arch *proc.Arch, regNum uint64) string {
	regName, _, _ := arch.DwarfRegisterToString(int(regNum), nil)
	return strings.ToLower(regName)
}

func machTargetExcToError(sig uint8) error {
	switch sig {
	case 0x91:
		return errors.New("bad access")
	case 0x92:
		return errors.New("bad instruction")
	case 0x93:
		return errors.New("arithmetic exception")
	case 0x94:
		return errors.New("emulation exception")
	case 0x95:
		return errors.New("software exception")
	case 0x96:
		return errors.New("breakpoint exception")
	}
	return nil
}

func checkRosettaExpensive() error {
	if runtime.GOOS != "darwin" {
		return nil
	}
	if runtime.GOARCH != "arm64" {
		return nil
	}

	// Additionally check the output of 'uname -m' if it's x86_64 it means that
	// the shell we are running on is being emulated by Rosetta even though our

View on GitHub (pinned to a23773e6c3)