Skip to content

[CM async] panic performing blocking operation during core start function #12391

@lukewagner

Description

@lukewagner

Currently, this WAST:

(assert_trap
  (component
    (core module $Memory (memory (export "mem") 1))
    (core instance $memory (instantiate $Memory))
    (core module $M
      (import "" "waitable-set.new" (func $waitable-set.new (result i32)))
      (import "" "waitable-set.wait" (func $waitable-set.wait (param i32 i32) (result i32)))
      (func $start
        (drop (call $waitable-set.wait (call $waitable-set.new) (i32.const 0)))
      )
      (start $start)
    )
    (canon waitable-set.new (core func $waitable-set.new))
    (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
    (core instance $m (instantiate $M (with "" (instance
      (export "waitable-set.new" (func $waitable-set.new))
      (export "waitable-set.wait" (func $waitable-set.wait))
    ))))
  )
  "cannot block a synchronous task before returning"
)

panics with:

thread 'main' (2367885) panicked at crates/wasmtime/src/runtime/component/concurrent.rs:1517:39:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: wasmtime::runtime::component::concurrent::<impl wasmtime::runtime::store::StoreOpaque>::check_blocking
   5: wasmtime::runtime::component::concurrent::<impl wasmtime::runtime::component::instance::Instance>::waitable_set_wait

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixing

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions