C API: wasm_valtype_kind() aborts the process for v128
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in crates/c-api/src/types/val.rs at the ValType::V128 arm, then check the wasm_valkind_t definition in wasm.h and the existing wasmtime_valtype_new() handling. Determine the supported behavior for v128 and check the relevant C API tests and documentation. Done means this call no longer aborts the process and its behavior is documented or otherwise defined.
索引モデルが issue の本文から書いたものです。
説明
Thanks for filing a bug report! Please fill out the TODOs below.
Note: if you want to report a security issue, please read our security policy!
Test Case
No Wasm file is needed; the C API call alone reproduces it:
#include <stdio.h>
#include <wasm.h>
#include <wasmtime.h>
int main(void) {
wasm_valtype_t *t = wasmtime_wasm_valtype_v128();
printf("calling wasm_valtype_kind on a v128 valtype...\n");
fflush(stdout);
wasm_valkind_t k = wasm_valtype_kind(t); /* aborts */
printf("kind = %d\n", (int)k);
wasm_valtype_delete(t);
return 0;
}
Steps to Reproduce
- Build the program above against the Wasmtime C API (
cc repro.c -lwasmtime). - Run it.
Expected Results
wasm_valtype_kind() does not take the host process down. wasm.h's wasm_valkind_t has no v128
member, so either a documented Wasmtime-specific value is returned for v128, or the function's
documentation says it must not be called on v128 types and points to wasmtime_valtype_new(),
which already handles v128 (wasmtime_valtype_t::V128) and is what the C++ API uses.
Actual Results
The process aborts:
calling wasm_valtype_kind on a v128 valtype...
`support for v128 ` is not implemented
Aborted (exit code 134)
The cause is the // TODO arm in crates/c-api/src/types/val.rs:
pub extern "C" fn wasm_valtype_kind(vt: &wasm_valtype_t) -> wasm_valkind_t {
match vt {
...
// TODO
ValType::V128 => crate::abort("support for v128 "),
It is still there on main (81231fd, 2026-10-30).
Versions and Environment
Wasmtime version or commit: 50.0.1 (the libwasmtime shipped in the wasmtime-py 50.0.1 wheel); the
same code is on main at 81231fd
Operating system: Linux (Ubuntu 24.04)
Architecture: x86_64
Extra Info
Embedders that inspect function or global types with the standard wasm.h API hit this as soon as a
module uses v128 in a signature. wasmtime-py 50.0.1 does (its ValType.__eq__/__str__ call
wasm_valtype_kind()), so calling an export with a v128 parameter aborts the Python interpreter:
bytecodealliance/wasmtime-py#348. We found it while running the WebAssembly spec suite
(test/core/simd) through wasmtime-py as a reference implementation.
- 主要言語
- Rust
- スター
- 18.8k
- フォーク
- 1.9k
- 平均マージ
- 22時間 5分
- マージ済み PR(30日)
- 375
環境構築
- 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 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 40/100
bytecodealliance/wasmtime#15128 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
bytecodealliance/wasmtime#15112 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wasi-http
難易度 3/5 半日 初心者へのやさしさ 22/100
bytecodealliance/wasmtime#15111 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wasmtime の issue をすべて見る
似ている issue
-
docs(metrics): replace stale src/metrics.rs line anchors in dashboard-metrics.md with symbol namesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
vfarcic/dot-agent-deck#2079 ·
メンテナーはふだん 1 日以内に返信
-
修改文件名时主键盘上的数字无法输入オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
qingjian-team/qingjian#894 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
rubys/roundhouse#1757 ·
-
enhancement user-priority/P3
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信