Hyperlink arena exhaustion (StringAllocOutOfMemory) spins the write path instead of degrading
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript, wasm
調査の方向性
terminal.write パスと StringAllocOutOfMemory を出力するハイパーリンク処理から始め、その後、レポートで説明されている WASM invoke パスを追跡します。枯渇したアリーナが各 OSC 8 シーケンスを通り過ぎて進むか確認します。完了の条件は、高密度な単一 write がスピンせずに戻り、ハイパーリンクが適切に機能低下することです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 2.9k
- フォーク
- 174
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/ghostty-web のほかの issue
-
attachCustomKeyEventHandler inverts xterm.js's return-value contract (silently swallows all input) オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
coder/ghostty-web#192 ·
-
A single throw inside render() permanently stops the render loop, and a consumer cannot restart it オープン
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
coder/ghostty-web#189 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
coder/ghostty-web#188 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
coder/ghostty-web#187 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
coder/ghostty-web#184 ·
coder/ghostty-web の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100