CommandCodeAI / CommandCodeAI/command-code

RuntimeError: memory access out of bounds in yoga-layout WASM during "Loading sessions"

Abierto
#839 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
4k
Forks
350
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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:

  1. React's reconciler destroying nodes (calling freeRecursive() via cleanupYogaNode in removeChild/removeChildFromContainer)
  2. 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el fallo intermitente durante el inicio mientras aparece “Loading sessions…”. Lee renderer.js:32 y las rutas de cleanupYogaNode en removeChild y removeChildFromContainer; después, sigue cómo el callback de renderizado con debounce conserva los nodos. La tarea estará completada cuando la carga de sesiones ya no provoque el fallo de acceso a memoria de WASM al leer el layout.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, node.js, wasm
Área
cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.