Hyperlink arena exhaustion (StringAllocOutOfMemory) spins the write path instead of degrading
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript, wasm
Direzione di ricerca
Inizia dal percorso terminal.write e dalla gestione dei collegamenti ipertestuali che emette StringAllocOutOfMemory, quindi segui il percorso WASM invoke descritto nel report. Verifica se un’arena esaurita avanza oltre ogni sequenza OSC 8; il lavoro è completato quando una singola scrittura densa ritorna invece di girare a vuoto e i collegamenti ipertestuali degradano in modo appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When the terminal's hyperlink string arena is exhausted, the write path appears to spin / not make forward progress instead of dropping the hyperlink and continuing. Writing a large, OSC 8-dense buffer in one shot floods this warning and then pins the thread:
warning(terminal): error reallocating for more hyperlink space, ignoring hyperlink err=error.StringAllocOutOfMemory
The ignoring hyperlink wording suggests the intent is to degrade gracefully, but in practice the containing write does not return.
Environment
ghostty-web@^0.4.0, running as WASM in an Electron renderer (embedded by Nimbalyst).- Trigger: replaying a terminal's saved scrollback (~500 KB, very hyperlink-dense — Claude Code / Codex emit many OSC 8 clickable file paths) into the terminal in a single write on session restore.
Observed behavior
- A burst of ~70 identical
StringAllocOutOfMemoryhyperlink warnings within ~7 ms, then silence. - The renderer's main thread then sits at ~100% of one core with 0 syscalls over a 6 s
stracesample — i.e. a pure userspace loop, not I/O or a lock. - A paused JS stack shows the top frame inside the WASM
invoketrampoline — control went into the terminal write and never came back.
So once the arena is full, processing the remaining OSC 8 sequences in that write seems to loop rather than skip-and-advance.
Question / hypothesis
- Is hyperlink-arena exhaustion expected to be recoverable within a single
terminal.write? It looks like the post-failure "ignoring hyperlink" path may retry the allocation (or fail to advance the parser) when the arena stays full for the next hyperlink in the same write, turning many consecutive OSC 8 sequences into an unbounded loop. - Could you point me to where
StringAllocOutOfMemoryfrom the hyperlink path is handled? If the fix is "drop the hyperlink, advance, and don't re-attempt until space frees", that would turn this from a hang into graceful degradation.
Caveats
I don't yet have a standalone ghostty-web reproduction — this was diagnosed through the Nimbalyst embedding (traces above). If a minimal repro would help, I can try to build one that writes a synthetic OSC 8-dense buffer larger than the arena in a single call; a pointer to the arena size / relevant source would speed that up.
Filing here since ghostty-web owns the WASM build; if this is upstream Ghostty behavior, happy to move it.
- Lingua principale
- TypeScript
- Stelle
- 2.9k
- Fork
- 182
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/ghostty-web
-
buffer translateToString()/getChars() return '' for empty cells, collapsing cursor-positioned textAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
coder/ghostty-web#205 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
coder/ghostty-web#204 ·
-
Alt+<printable key> sends the bare key with no ESC prefix (readline/emacs/tmux meta bindings lost)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
coder/ghostty-web#203 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
coder/ghostty-web#199 ·
-
Public buffer getChars and translateToString truncate multi-codepoint graphemesForse già presa @schickling-assistant l’ha presa 10 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
coder/ghostty-web#200 ·
Tutte le issue di coder/ghostty-web
Issue simili
-
area:tui enhancement platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
anthropics/claude-code#101490 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
netlify/netlify-mcp#75 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
atlassian-labs/compiled#1960 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
pnp/cli-microsoft365#7639 ·
I maintainer di solito rispondono entro 2 giorni
-
nextjs-tracking
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cloudflare/vinext#3887 ·
I maintainer di solito rispondono entro 1 giorno