[2.0] A long memo chain overflows the stack in the commit/settle path
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- frontend
Línea de trabajo
The bug is in the commit and settle walks, including settlePendingSource and the staged-error marking, which recurse once per memo node in the reactive graph. Start by reading those functions in the reactive core and reproducing with a warm-built chain of about 8,000 memos over a rejecting async source. Done means the walks are iterative with an explicit stack and the error surfaces as E:boomA at that depth.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
A chain of createMemo nodes over an async source, read under <Errored> with isPending, overflows the call stack in the commit/settle path once the chain is long enough.
- On
next, a warm-built chain of about 8,000+ memos surfacesE:Maximum call stack size exceededas the rendered error, in place of the source's own error. - With #4582 (the settle walk also stage-marks chain nodes via
stageMark), the walk recurses through chains too. At about 15,000 nodes it silently drops the stagedE:boomAframe instead of erroring.
Real apps rarely build chains this deep, but the error should be the source's (boomA), never a stack overflow, and a frame should never be dropped without an error.
Repro shape
- Make an async source that rejects with
new Error("boomA"). - Build a chain of N
createMemonodes, each reading the previous one, after the source has a first value (warm build). - Read the last memo under an
Erroredboundary, together withisPending(last), in a render effect that records frames. - Trigger the rejecting flight and flush.
With N ≈ 8,000 on next, the recorded error is Maximum call stack size exceeded. Expected: E:boomA.
Likely fix direction
Make the commit/settle walks (including settlePendingSource and the staged-error marking) iterative with an explicit stack, instead of recursing per node.
Found during review of #4582. It doesn't block that PR, because next already fails at a shallower depth.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 10 h 39 min
- PR fusionados (30 d)
- 500
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de solidjs/solid
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[2.0 / next] Optimistic todo list with an "N left" memo loops forever when a toggle's save landsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
[2.0 / next] createOptimisticStore: add, delete, add with saves pending hands <For> an undefined rowAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
🔊 a11y
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
betagouv/mon-entreprise#4726 ·
Los mantenedores suelen responder en 9 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Deltares/fews-pi-requests#357 ·
Los mantenedores suelen responder en 1 día
-
bug confirmed js v6
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día