Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Panic in concurrent.rs with async deadlock #71

@alexcrichton

Description

@alexcrichton

This input:

(component

  (component $child
    (core module $libc (memory (export "memory") 1))
    (core instance $libc (instantiate $libc))

    (type $future (future))
    (core func $read (canon future.read $future (memory $libc "memory")))

    (core module $m
      (import "" "read" (func $read (param i32 i32) (result i32)))

      (func (export "run") (param $future i32)
        (call $read (local.get $future) (i32.const 0))
        drop
      )
    )
    (core instance $i (instantiate $m
      (with "" (instance
        (export "read" (func $read))
      ))
    ))
    (func (export "run") (param "x" $future)
      (canon lift (core func $i "run")))
  )
  (instance $child (instantiate $child))

  (type $future (future))
  (core func $new (canon future.new $future))
  (core func $child-run (canon lower (func $child "run")))


  (core module $m
    (import "" "new" (func $new (result i32)))
    (import "" "child-run" (func $child-run (param i32)))

    (func (export "run")
      (call $child-run (call $new))
    )
  )
  (core instance $i (instantiate $m
    (with "" (instance
      (export "new" (func $new))
      (export "child-run" (func $child-run))
    ))
  ))

  (func (export "run")
    (canon lift (core func $i "run")))
)

(assert_trap (invoke "run") "something i don't know what")

currently fails with:

$ ../wasip3-prototyping/target/release/wasmtime wast -W component-model-async ./test.wast

thread 'main' panicked at /home/alex/code/wasip3-prototyping/crates/wasmtime/src/runtime/component/concurrent/futures_and_streams.rs:2238:59:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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