Component `Func::call` (sync call) can fail due to a lack of event loop
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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 の本文から書いたものです。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wasmtime のほかの issue
-
bug wasm-proposal:exceptions wasmtime:debugging
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bytecodealliance/wasmtime#14102 ·
メンテナーはふだん 1 日以内に返信
-
wasm-proposal:gc
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bytecodealliance/wasmtime#13808 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
cranelift cranelift:area:clif cranelift:goal:optimize-speed enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bytecodealliance/wasmtime#1598 · コメント 9 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wasm-proposal:component-model-async
難易度 4/5 3〜5日 初心者へのやさしさ 49/100
bytecodealliance/wasmtime#14949 ·
メンテナーはふだん 1 日以内に返信
-
aarch64: nested `stack_limit` global-value load with a large offset clobbers its own base registerオープンbug cranelift cranelift:area:aarch64
難易度 4/5 1〜2日 初心者へのやさしさ 58/100
bytecodealliance/wasmtime#14946 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wasmtime の issue をすべて見る
似ている issue
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001オープンbug known-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
project-minigraf/minigraf#734 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug CLI documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
openai/codex#56630 · コメント 3 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
DayuanJiang/PecoFence#139 ·
メンテナーはふだん 1 日以内に返信