mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #733] Crash: stale insert/remove on destroyed parent triggers Yoga wasm Out of bounds call_indirect #200
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#200
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GreyElaina on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/733
Summary
@opentui/solidcan call_insertNode -> parent.add(...)on a parent whose Yoga node was already freed. In that state, Yoga wasm traps with:RuntimeError: Out of bounds call_indirect (evaluating 'd.apply(null, p)')This looks like a missing destroyed-parent guard in core/reconciler paths.
Environment
@opentui/core:0.1.81@opentui/solid:0.1.81yoga-layout:3.2.11.3.9Deterministic minimal repro
Run:
Observed stack:
Real-world evidence (non-synthetic)
In a real app flow (fork panel close + async updates), instrumentation showed:
_insertNode -> addon that same parent,_removeNode -> removeon that same parent.Example from trace:
And mapped metadata:
Expected behavior
Operations targeting destroyed parents should be safely ignored (or warned in dev), not crash the process in Yoga wasm.
Proposed fix
Core guard in
Renderable:add(...): early return ifthis._isDestroyedinsertBefore(...): early return ifthis._isDestroyedremove(...): early return ifthis._isDestroyedSolid guard in reconciler:
_insertNode(...): no-op if parent is destroyed_removeNode(...): no-op if parent is destroyedThese are defensive checks: healthy flows should be unaffected; stale work becomes benign instead of fatal.
Additional context
This seems in the same family as prior lifecycle/reconciler race fixes, but I could not find an existing issue that exactly covers destroyed-parent Yoga calls in
solid + core.