RuntimeError: memory access out of bounds in yoga-layout WASM during "Loading sessions"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js, wasm
- Ambito
- cli
Direzione di ricerca
Riproduci il crash intermittente all’avvio durante “Loading sessions…”. Leggi renderer.js:32 e i percorsi di cleanupYogaNode in removeChild e removeChildFromContainer, quindi traccia il modo in cui il callback di rendering con debounce mantiene i nodi. Il lavoro è completato quando il caricamento delle sessioni non provoca più il crash di accesso alla memoria WASM durante la lettura del layout.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 4k
- Fork
- 350
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 CommandCodeAI/command-code
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#855 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CommandCodeAI/command-code#841 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#655 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#608 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
CommandCodeAI/command-code#893 ·
Tutte le issue di CommandCodeAI/command-code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
hust-open-atom-club/hustmirror-cli#52 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
milvus-io/birdwatcher#545 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
JuliusBrussee/caveman#1102 · 1 commento ·