Exception Reference Global Panics Coredump Serialization
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
crates/wasmtime/src/runtime/coredump.rs の WasmCoreDump::_serialize と、報告された panic 周辺の reference-type の match から始めます。提供されている exnref-coredump.wat の再現ケースを coredump 対応の wasmtime コマンドで実行し、exnref のグローバルが unreachable!() に到達しなくなっていること、また guest の trap が host の panic を引き起こさないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Summary
When WebAssembly coredump capture is enabled, an untrusted module containing a valid exnref global can turn an ordinary guest trap into a Rust panic in the host. Coredump serialization assumes every reference type belongs to the external, function, or anyref families; the exception-reference family reaches an unreachable!() arm instead of being encoded or rejected.
Detail
After the guest traps, WasmCoreDump::_serialize recreates module globals in the core dump. For reference-valued globals it calls r.heap_type().top() and handles only Extern, Func, and Any:
ValType::Ref(r) => match r.heap_type().top() {
HeapType::Extern => wasm_encoder::ValType::EXTERNREF,
HeapType::Func => wasm_encoder::ValType::FUNCREF,
HeapType::Any => wasm_encoder::ValType::Ref(wasm_encoder::RefType::ANYREF),
ty => unreachable!("not a top type: {ty:?}"),
},
The exception-reference top type is Exn, so a mutable exnref global reaches the final arm. The reproducer enables the existing coredump option and invokes an exported function containing unreachable; no harness or source change is involved.
Reproduce
set -eu
git clone --depth 1 https://github.com/bytecodealliance/wasmtime.git
cd wasmtime
git rev-parse HEAD
cargo build --bin wasmtime --no-default-features \
--features 'run,wat,cranelift,compile,coredump,clap/default,clap/wrap_help'
cat > exnref-coredump.wat <<'WAT'
(module
(global (export "g") (mut exnref) (ref.null exn))
(func (export "trap")
unreachable))
WAT
set +e
RUST_BACKTRACE=0 ./target/debug/wasmtime run -D coredump=guest.dump \
--invoke trap exnref-coredump.wat
status=$?
set -e
printf 'exit=%s\n' "$status"
Observed output on the affected HEAD:
3ebfbe5af4927c157d6fcaca42b8dbb6d17b73fb
thread 'main' (...) panicked at crates/wasmtime/src/runtime/coredump.rs:194:31:
internal error: entered unreachable code: not a top type: Exn
exit=101
- 主要言語
- Rust
- スター
- 18.7k
- フォーク
- 1.9k
- 平均マージ
- 22時間 27分
- マージ済み PR(30日)
- 383
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wasmtime のほかの issue
-
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 日以内に返信
-
RUSTSEC-2026-0386: `AsyncFd::new` and related constructors violate I/O safety対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 15/100
bytecodealliance/wasmtime#14977 ·
メンテナーはふだん 1 日以内に返信
-
Read-only access to numeric globals from epoch/call hooks (`StoreHookState`)対応中かも @smarcd が 1 日前に担当しました。 オープンenhancement wasmtime:api
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
bytecodealliance/wasmtime#14965 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
bytecodealliance/wasmtime#14960 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wasmtime の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
rust-bitcoin/rust-bitcoin#7089 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
area/tools bug session-analysis
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Python OpenTelemetrySectionConfig has no file_sinks再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/NeMo-Relay#1514 ·
メンテナーはふだん 1 日以内に返信
-
prompting proposal tool triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
can1357/oh-my-pi#17041 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
nix-community/fenix#262 ·