CommandCodeAI / CommandCodeAI/command-code
RuntimeError: memory access out of bounds in yoga-layout WASM during "Loading sessions"
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 4k
- Forks
- 350
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Reproduza a falha intermitente durante a inicialização enquanto “Loading sessions…” é exibido. Leia renderer.js:32 e os caminhos de cleanupYogaNode em removeChild e removeChildFromContainer; em seguida, rastreie como o callback de renderização com debounce retém os nós. A tarefa estará concluída quando o carregamento das sessões não provocar mais a falha de acesso à memória do WASM durante a leitura do layout.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, node.js, wasm
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 52/100