Summary
On some Apple Silicon machines, the browse binary compiled by bun run build ships with a corrupt or linker-only code signature. macOS then kills every invocation with SIGKILL (zsh: killed, exit 137, 0 bytes output). The official ./setup never recovers — every re-run produces the same unrunnable binary.
The fix is two lines of codesign. I think it belongs in setup so Apple Silicon users don't have to diagnose this.
Environment
- macOS Darwin 25.4.0 (arm64)
- Apple Silicon
- Bun 1.3.12 (freshly installed per README requirement)
- gstack v0.16.4.0
- SIP enabled, Xcode Command Line Tools installed
- Fresh
git clone + ./setup install (no vendoring)
Reproduction
# Official install path
git clone --depth 1 https://github.com/garrytan/gstack.git ~/.claude/skills/gstack
cd ~/.claude/skills/gstack && ./setup
# Try to use browse
~/.claude/skills/gstack/browse/dist/browse status
# => zsh: killed
In Claude Code, every $B <cmd> call returns exit 137 with 0 bytes stdout/stderr. From a login shell terminal, zsh: killed.
Root cause
otool -l on the compiled binary shows a valid LC_CODE_SIGNATURE load command, but the signature block itself is corrupt/empty:
cmd LC_CODE_SIGNATURE
cmdsize 16
dataoff 61283152
codesign -dv reports code object is not signed at all. spctl --assess --verbose <binary> returns invalid or unsupported format for signature.
A naive codesign -s - -f <binary> also fails with "invalid or unsupported format for signature" because the existing (broken) signature block prevents re-signing. The only path that works is remove → re-sign:
codesign --remove-signature <binary>
codesign -s - -f <binary>
After that, codesign -dv shows Signature=adhoc and the binary runs cleanly.
This matches the well-documented Apple Silicon policy: all executables must be properly signed (even ad-hoc), and linker-signed-only binaries get SIGKILL (Bun #7208, Go #42684, Bun docs on codesigning).
Why it hits some users and not others seems to depend on Bun version (1.3.x appears worse than 1.2.x at self-signing) and whether a prior corrupt signature exists from an earlier install.
Suggested fix
Add a macOS-only codesign step to setup after bun run build succeeds. Something like:
if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
for bin in browse/dist/browse browse/dist/find-browse design/dist/design bin/gstack-global-discover; do
[ -x \"$bin\" ] || continue
codesign --remove-signature \"$bin\" 2>/dev/null || true
codesign -s - -f \"$bin\" 2>/dev/null || log \"warning: codesign failed for $bin\"
done
fi
This is idempotent (safe to re-run), costs <1s, and is what Bun's own docs recommend for distributed standalone executables. It would save Apple Silicon users from a dead-end debug session.
Workaround (for anyone hitting this now)
cd ~/.claude/skills/gstack
codesign --remove-signature browse/dist/browse
codesign -s - -f browse/dist/browse
# repeat for browse/dist/find-browse, design/dist/design, bin/gstack-global-discover
Happy to open a PR if helpful.
Related
Summary
On some Apple Silicon machines, the
browsebinary compiled bybun run buildships with a corrupt or linker-only code signature. macOS then kills every invocation with SIGKILL (zsh: killed, exit 137, 0 bytes output). The official./setupnever recovers — every re-run produces the same unrunnable binary.The fix is two lines of
codesign. I think it belongs insetupso Apple Silicon users don't have to diagnose this.Environment
git clone+./setupinstall (no vendoring)Reproduction
In Claude Code, every
$B <cmd>call returns exit 137 with 0 bytes stdout/stderr. From a login shell terminal,zsh: killed.Root cause
otool -lon the compiled binary shows a validLC_CODE_SIGNATUREload command, but the signature block itself is corrupt/empty:codesign -dvreportscode object is not signed at all.spctl --assess --verbose <binary>returnsinvalid or unsupported format for signature.A naive
codesign -s - -f <binary>also fails with "invalid or unsupported format for signature" because the existing (broken) signature block prevents re-signing. The only path that works is remove → re-sign:After that,
codesign -dvshowsSignature=adhocand the binary runs cleanly.This matches the well-documented Apple Silicon policy: all executables must be properly signed (even ad-hoc), and linker-signed-only binaries get SIGKILL (Bun #7208, Go #42684, Bun docs on codesigning).
Why it hits some users and not others seems to depend on Bun version (1.3.x appears worse than 1.2.x at self-signing) and whether a prior corrupt signature exists from an earlier install.
Suggested fix
Add a macOS-only codesign step to
setupafterbun run buildsucceeds. Something like:This is idempotent (safe to re-run), costs <1s, and is what Bun's own docs recommend for distributed standalone executables. It would save Apple Silicon users from a dead-end debug session.
Workaround (for anyone hitting this now)
Happy to open a PR if helpful.
Related