Repository navigation
poisoning: entry refusals name the original trap (#145 ask 1) - #148
Merged
Merged
Conversation
"cannot enter component instance" covers two states an embedder cannot tell apart: a transient reentrance overlap and a permanently poisoned instance. #145's downstream investigation lost a day to that ambiguity, chasing caller-side call overlap while the instance was simply dead. The scheduler's poisoned-instance WeakSet becomes a WeakMap recording the FIRST poisoning cause per instance (follow-on failures against a corpse are noise); the entry-refusal sites (host entry in exec/boundary.ts, sync/async start-call in intrinsics/fact_calls.ts, enter-sync-call in intrinsics/mod.ts, gated dtor in cabi/handles.ts) append "— instance poisoned by: <original trap>" via withPoisonCause. The transient refusal stays byte-identical, and the suffix is conformance-safe: the official suite matches trap messages by substring (harness/src/runner.ts); builtin-trap-poisons-instance.wast still passes. instancePoisonCause() is exported for programmatic queries; no embedder-api amendment yet — the message carries the cause. Also: CGO-1 in upstream-consumer-findings.md (componentize-go's cabi_realloc can call clock imports under GC pacing — the #145 root cause; filing is the operator's call), and the tracker scope line widens to cover consumer toolchains. The host-entry lowering gap found by the #145 review (realloc outside the may_leave window, the cabi/context.ts v1 simplification) is #147. Gates: test-runtime, conformance, sched-seeds, test-wasi, test-ct-runner, test-bundle, publish-check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ask 1 of #145 — pure diagnosability, no semantic change.
What
task/scheduler.ts: the poisoned-instanceWeakSetbecomes aWeakMapkeyed by instance, recording the first poisoning cause (follow-on failures against a corpse are noise).instancePoisonCause()exported;isInstancePoisoned()unchanged.exec/boundary.ts), sync/async start-call (intrinsics/fact_calls.ts), enter-sync-call bracket (intrinsics/mod.ts), gated dtor (cabi/handles.ts) — append— instance poisoned by: <original trap>when, and only when, the target is poisoned. A transient reentrance refusal stays byte-identical, which is exactly the disambiguation Go components trap (and poison their instance) when the Go runtime reads the clock inside cabi_realloc #145 asked for.harness/src/runner.ts:319);builtin-trap-poisons-instance.waststill passes.runtime/tests/poison_cause_test.ts(first-cause-wins, suffix shape, transient unchanged, non-Error/unprintable causes); e2e after-poison refusal asserts the suffix; the sibling-cycle transient test asserts its absence.upstream-consumer-findings.md— the componentize-go root cause (cabi_realloccalling clock imports under GC pacing), filing upstream is the operator's call. The adjacent deltic-side finding from the Go components trap (and poison their instance) when the Go runtime reads the clock inside cabi_realloc #145 review (host-entry lowering runs realloc outside the may_leave window) is Host-entry lowering runs cabi_realloc outside the may_leave window (context.ts v1 simplification) #147.Not in scope
may_leavesemantics change (Go components trap (and poison their instance) when the Go runtime reads the clock inside cabi_realloc #145 ask 2) — see the review comment on the issue and Host-entry lowering runs cabi_realloc outside the may_leave window (context.ts v1 simplification) #147 for the decision owed.Gates
test-runtime(504/0, incl. 4 new),conformance(1254 passed / 0 failed / 95 expected xfail, no stale),sched-seeds(seeds 1 and 4242 + seeded conformance),test-wasi,test-ct-runner,test-bundle,publish-check. Browser/shell lanes untouched by this change run post-merge as usual.