Skip to content

Pinned Wasmtime reentrancy fixture crosses a synchronous instance boundary #380

Description

@lannbot

Finding

Pinned Wasmtime cc546eee265b805dda0f034b2007d110a541093d adds
tests/misc_testsuite/component-model/thread-transparency/reentrancy.wast.
Its line 114 expects the outer thread to reenter Mid and reach a guest
unreachable. Component Model reference a53b241d4d50487d256900fcad77cd6cda51808f
requires an earlier synchronous-block trap.

Evidence

  • Outer.run is async-typed and callback-lifted. It creates a second ready Outer
    thread with thread.resume-later, then calls Mid.f.
  • Mid.f is synchronous-typed and synchronously lifted. It calls Inner.g.
  • Inner.g is async-typed but synchronously lifted. It waits on a fresh empty
    waitable set, with no producer.
  • Inner's async canon_lift returns blocked. Mid's sync canon_lower waits for
    the result. Mid's synchronous canon_lift must drive only ready threads in
    Mid's own instance and trap when that candidate set is empty.
  • Mid has no eligible thread. Outer's ready thread is in another instance.

Authorities in pinned definitions.py: canon_lift (sync instance-local loop),
canon_lower (sync wait for resolution), Thread.resume (explicit direct
transfers), and Store.tick (top-level nesting requirement). No direct transfer
occurs in this fixture; resume-later only makes a thread ready.

Polyengine trace confirms an empty Mid candidate set and a ready Outer thread.
The result is wasm trap: cannot block a synchronous task before returning,
not the fixture's wasm unreachable instruction executed category. This is
independent of FIFO/seed choice because Mid has zero candidates.

Handling

Keep the supplementary assertion executed and classify the exact mismatch
separately from runtime defects. Do not equate the two trap conditions, exclude
the file, or widen the synchronous candidate set. Revisit after upstream
adjudication or a future spec/test revision.

This finding is based on pinned source and a polyengine trace, not a newly
measured native Wasmtime run. No upstream issue/comment has been filed.

Related inventory: #372.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions