modd icon indicating copy to clipboard operation
modd copied to clipboard

modd immediately killed on macOS ARM64 (Apple Silicon) with no useful error message

Open canrozanes opened this issue 8 months ago • 2 comments

Description

On a new Apple Silicon Mac (macOS ARM64), running modd in a Go project results in the process being immediately killed with no helpful error messages. Even after reinstalling and attempting dry-run or debugger steps, the issue persists.

System Info

  • macOS: Sonoma (Apple Silicon)
  • Architecture: arm64
  • Go version: go1.22.4 darwin/arm64
  • Modd binary: built from latest version via go install github.com/cortesi/modd/cmd/modd@latest

Observed Behavior:

Running:

$ modd

results in:

[1]    22082 killed     modd

canrozanes avatar May 16 '25 15:05 canrozanes

Does go run github.com/cortesi/modd/cmd/modd@latest work? could be code signing issue, i've seen issues copying a binary over an old version, but removing it first works.

wader avatar May 17 '25 19:05 wader

@wader Thanks for the suggestion to try go run github.com/cortesi/modd/cmd/modd@latest

Running directly via go run worked and that helped narrow down the issue.

Here's what I found.

  • modd was being immediately killed with no output.
  • go run worked fine, which suggested the issue wasn’t in the code itself.
  • I ruled out system-level issues like memory pressure, SIP, etc.
  • It turned out that macOS was killing the binary due to an invalid code signature, confirmed via a crash report showing:
SIGKILL (Code Signature Invalid)
Termination Reason: Namespace CODESIGNING, Code 2 Invalid Page

The fix was to manually re-sign the binary with an ad-hoc signature:

codesign --force --deep --sign - /Users/can/Development/go/bin/modd

canrozanes avatar May 18 '25 02:05 canrozanes