Parents: #495, #477 Related: #896, #888, #480
Source finding
At 656f4d81, private exception state has several aliases:
CContextGroup.pending_exceptionpoints to a stable nativeBoxedexception, containing both.valueand.exception_encoded(a separate encoded value handle).privateSetPendingValue/JSC__VM__throwErrorcopy the thrown value intoContext.private_pending_exception_root.Binding.relocateRootsrewrites that Context copy, but the exception box and its encoded-value box have no corresponding relocation edge unless independently protected.privateMaterializeTerminationcachesgroup.termination_exception; clearing the pending exception drops the Context root while retaining that cache for later reuse.
The canonical private object-box map is explicitly weak. Reconciliation of that map is not a substitute for tracing and rewriting these VM-owned exception aliases.
This is a source-audit finding, not a measured dangling dereference. Arena-only groups do not move or reclaim their managed values; deterministic witnesses must use the supported precise-heap profile and obey its actual host-handle protection contract.
Required work
- Reproduce pending-exception identity across a real moving nursery collection and compaction, with native-stack scanning disabled.
- Reproduce cached termination lifetime across pending clear, full collection, and a later termination request.
- Establish one durable ownership/relocation contract for the VM-owned exception, the encoded value returned by
JSC__Exception__asJSValue/JSC__JSValue__toError_, and any explicitly protected exception handles supported by the pinned profile. - Preserve first-pending-exception identity, sibling-realm ownership, retirement, clear/take behavior, and exact release at teardown. Do not mutate an already exposed exception to represent an unrelated later failure.
- Keep allocation-failure admission work in #896 coordinated with this ownership fix. Do not rely on fallible root registration after publishing an exception, conservative stack retention, retaining all cells, disabling movement, or an emergency pool.
Acceptance: deterministic native/engine allocation faults where relevant, actual nursery/major/compaction witnesses, precise private ABI lifecycle fixtures, full units, and suppression-free TSan. Link measured failures and implementation commits separately from this source finding.
Security scope is engine state and lifetime integrity in the pinned embedding profile; no embedding sandbox or permission policy is involved.