Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Component `Func::call` (sync call) can fail due to a lack of event loop

オープン
#14,950 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

Start by reading the Func::call and Func::call_async implementations and the component runtime event loop and fiber handling. Reproduce the supplied component example and inspect how its async function is called through the synchronous entry point. The issue leaves the design unresolved; done would require an agreed approach, such as deprecating Func::call, and tests covering the behavior.

索引モデルが issue の本文から書いたものです。

説明

wasm-proposal:component-model-async

This program:

use wasmtime::component::{Component, Linker};
use wasmtime::{Engine, Store};

fn main() {
    let engine = Engine::default();
    let component = Component::new(
        &engine,
        r#"
(component
  (component $inner
    (core module $m
      (func (export "f") (param i32) (result i32)
        (i32.add (local.get 0) (i32.const 3))))
    (core instance $i (instantiate $m))
    (func (export "f") async (param "x" u32) (result u32)
      (canon lift (core func $i "f"))))
  (instance $inner (instantiate $inner))

  (core func $f (canon lower (func $inner "f")))
  (core module $m
    (import "" "f" (func $f (param i32) (result i32)))
    (func (export "run") (param i32) (result i32) (call $f (local.get 0))))
  (core instance $i (instantiate $m (with "" (instance (export "f" (func $f))))))
  (func (export "run") (param "x" u32) (result u32)
    (canon lift (core func $i "run")))
)
"#,
    )
    .unwrap();
    let mut store = Store::new(&engine, ());
    let instance = Linker::new(&engine).instantiate(&mut store, &component).unwrap();
    let run = instance
        .get_typed_func::<(u32,), (u32,)>(&mut store, "run")
        .unwrap();
    println!("{:?}", run.call(&mut store, (4,)));
}

currently yields:

$ cargo run
thread 'main' panicked at .../wasmtime-50.0.0/src/runtime/bug.rs:63:13:
BUG: Instance::start_call called without a running event loop

If call_async is used, however, this works fine. This is something where the spec has changed over time where originally we could rely on normal component model traps to ensure that Func::call pretty much worked as expected, but with recent spec changes it effectively requires the event loop to be running and to activate fibers and such.

In essence a synchronous entrypoint for component model functions is no longer really compatible with the component model spec definition. I don't know exactly how to thread this needle myself, but we may want to consider deprecating Func::call.

主要言語
Rust
スター
18.7k
フォーク
1.9k
平均マージ
20時間 33分
マージ済み PR(30日)
377

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/wasmtime のほかの issue

bytecodealliance/wasmtime の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。