CommandCodeAI / CommandCodeAI/command-code
RuntimeError: memory access out of bounds in yoga-layout WASM during "Loading sessions"
まだ誰も着手していません。
- 主要言語
- 言語のデータがありません
- スター
- 4k
- フォーク
- 350
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Crash Report
Error
✖ CRITICAL: Uncaught Exception!
✖ ERROR → RuntimeError
ℹ REASON → memory access out of bounds
Stack Trace
RuntimeError: memory access out of bounds
at wasm://wasm/000460e2:wasm-function[215]:0xd5ef
at wasm://wasm/000460e2:wasm-function[185]:0xcf8c
at X.getComputedWidth (yoga-wasm-base64-esm.js:33:52)
at renderer (renderer.js:32:49)
at onRender (ink.js:348:56)
at debounce (debounce.mjs:12:17)
at invoke (debounce.mjs:45:9)
at onTimerEnd (debounce.mjs:51:17)
at Timeout._onTimeout (debounce.mjs:59:4)
Environment
- Command Code version: 1.53.0
- Node.js: v26.1.0 (via nvm)
- yoga-layout: 3.2.1
- ink: 7.1.0
- OS: Linux
Reproduction
This crash occurs during "Loading sessions…" — it happens intermittently when the app starts up and loads saved sessions.
Trace ID
3a1270ebb1c389e7db6257397a21f5e0
Analysis
The crash happens in renderer.js:32 when node.yogaNode.getComputedWidth() is called on a yoga node whose WASM memory has already been freed. This appears to be a race condition between:
- React's reconciler destroying nodes (calling
freeRecursive()viacleanupYogaNodeinremoveChild/removeChildFromContainer) - The debounced render callback still trying to traverse the node tree and compute layout on the now-deallocated WASM node
This is triggered when rapid state changes occur (e.g., mounting/unmounting components during "Loading sessions"), causing a yoga node to be freed in one tick while the throttled renderer still holds a reference.
Suggested Fix
Add a guard in renderer.js to check whether yogaNode is still valid before calling getComputedWidth(), or wrap the WASM call in a try-catch to handle freed nodes gracefully.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
「Loading sessions…」の表示中に起動時に断続的に発生するクラッシュを再現します。renderer.js:32 と、removeChild および removeChildFromContainer 内の cleanupYogaNode の経路を読み、その後、デバウンスされたレンダーコールバックがどのようにノードを保持するかを追跡します。レイアウトの読み取り時に、セッションの読み込みによって WASM のメモリアクセス・クラッシュが発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js, wasm
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100