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.

Internal panic with cancellation #146

@alexcrichton

Description

@alexcrichton

This test, notably:

    // Cancel an import in-progress
    wit_bindgen::block_on(async {
        let (tx, rx) = wit_future::new();
        let mut import = Box::pin(pending_import(rx));
        assert!(import
            .as_mut()
            .poll(&mut Context::from_waker(noop_waker_ref()))
            .is_pending());
        drop(import);
        tx.write(()).await.unwrap_err();
    });

passed before #143 but is failing after. The import this is calling is defined here and is intended to just sit pending in the "started" state.

Reproduction after bytecodealliance/wit-bindgen#1264 merges can be done with:

$ cd wasip3-prototyping
$ cargo build --features component-model-async
$ cd ../wit-bindgen
$ cargo run test -l rust --artifacts target/artifacts --rust-wit-bindgen-path ./crates/guest-rust --rust-target wasm32-wasip1 --runner '../wasip3-prototyping/target/debug/wasmtime -W component-model-async' tests/runtime-async -f cancel-import
Building `wit-bindgen` from crates.io...
Compiling 2 components:
..
Running 1 runtime tests:
F
------ Failure: cancel-import --------
  runner: tests/runtime-async/async/cancel-import/runner.rs
  compiled runner: /home/alex/code/wit-bindgen/target/artifacts/cancel-import/runner-rust.wasm
  test: tests/runtime-async/async/cancel-import/test.rs
  compiled test: /home/alex/code/wit-bindgen/target/artifacts/cancel-import/test-rust.wasm
  error: failed to run `cancel-import`

  Caused by:
      command execution failed
      command: "../wasip3-prototyping/target/debug/wasmtime" "-W" "component-model-async" "/home/alex/code/wit-bindgen/target/artifacts/cancel-import/composed-runner.rs-test.rs.wasm"
      status: exit status: 101
      stderr:
        about to drop import

        thread 'main' panicked at crates/wasmtime/src/runtime/component/concurrent.rs:2246:17:
        assertion failed: task.event.is_none()
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

1 tests FAILED

Metadata

Metadata

Assignees

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