ghostty-crash
Debugging a ghostty crash
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Debugging a ghostty crash
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Drive a real browser during frontend work — verify a change rendered, click through a flow, fill forms, read console errors, take screenshots, or debug performance/memory/network. Use whenever interacting with a local web app in a browser (Playwright script templates, chrome-devtools tradeoffs, SPA mock-API gotchas).
How to use the tviz CLI to read and write Things 3 tasks
For non-Codex agents, get a Codex second opinion on your changes. Claude sends the diff to Codex for review, discusses the feedback, and synthesizes actionable results.
Productivity coach
Read Oxide RFD contents, metadata, and images by number using rfd-cli. Use when an RFD comes up (e.g. "RFD 63", "what does the networking RFD say") and you need the actual text.
How to delegate a task to an opencode pseudo-subagent (default model Kimi K2.6). Use ONLY when the user explicitly invokes /opencode or names opencode by name — not for general subagent or delegation requests.
Baseado na classificação ocupacional SOC
| name | ghostty-crash |
| description | Debugging a ghostty crash |
List dumps with ghostty +crash-report.
Crash dumps live in ~/.local/state/ghostty/crash/.
A .ghosttycrash file has two parts:
MDMP magicRead JSON metadata (everything before MDMP). The header contains multiple JSON lines; the last line is the main Sentry event:
OFFSET=$(LC_ALL=C grep -ob 'MDMP' <crashfile> | head -1 | cut -d: -f1)
head -c $OFFSET <crashfile> | tail -1 | python3 -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2))"
This replaces the current "Read JSON metadata" section. The key change is adding | tail -1 to grab only the last JSON line (the main Sentry event), avoiding the Extra data parse error from the multi-line format.
Extract the minidump:
tail -c +`LC_ALL=C grep -ob 'MDMP' <crashfile> | head -1 | cut -d: -f1 | xargs -I{} expr {} + 1` <crashfile> > /tmp/crash.dmp
Analyze with minidump-stackwalk (install via cargo install minidump-stackwalk):
minidump-stackwalk /tmp/crash.dmp
Symbolicate addresses with atos. Get base address from minidump output (look for "ghostty" module):
atos -o /Applications/Ghostty.app/Contents/MacOS/ghostty -l <base_addr> <crash_addr>
Threads: Thread 0 is main/UI. Renderer runs on its own thread. Terminal I/O (termio) uses worker threads for processing input and running child processes.
Key source paths (in ghostty repo):
src/terminal/ - terminal emulation, pages, reflowsrc/renderer/ - Metal/OpenGL renderingsrc/termio/ - PTY and input handlingmacos/Sources/ - Swift UI layerCrash patterns:
EXC_BAD_ACCESS with address like 0xffffffff???????? usually indicates corrupted pointer arithmetic (e.g., bad offset added to valid base)EXC_BREAKPOINT in Swift code indicates runtime assertion failureWhen comparing crashes: Look at uptime (session duration in JSON), thread ID, and register values. Same crash in same function with different addresses but similar register patterns suggests same root cause.
Ghostty is written in Zig with platform-specific layers (Swift for macOS, GTK for Linux).
Build and test:
zig build # debug build
zig build -Doptimize=ReleaseFast # release build
zig build test # run tests
zig build test -Dtest-filter="PageList" # filter tests by name
Threading model: Terminal state is protected by renderer_state.mutex (defined in src/renderer/State.zig). The renderer locks it during frame updates; termio locks it during resize and input processing. Look for renderer_state.mutex.lock() to trace critical sections.
Finding callers: Use grep for function names. Zig uses foo.bar() method syntax but defines as fn bar(self: *Foo), so search for both the method name and struct type.
Record findings in CRASH.md, including the dump filename and the commands required to reproduce the analysis.