`wasmtime wast` ignores `-W max-memory-size` and other store limits

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust, wasm
領域
backend, testing

調査の方向性

Read src/commands/wast.rs and trace how each store is configured through CommonOptions::configure_store; compare it with RunCommon::store_limits and the wasmtime run behavior described in the issue. Check existing WAST tests for store limits and add coverage for memory and table limits. Done when wasmtime wast applies the configured limits or clearly rejects unsupported limit options, without silently allowing growth.

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

説明

bug
Test Case

limit.wast:

(module
  (memory 1)
  (func (export "grow") (param i32) (result i32) (memory.grow (local.get 0))))
(assert_return (invoke "grow" (i32.const 10)) (i32.const -1))
Steps to Reproduce
  • wasmtime wast -W max-memory-size=65536 limit.wast
  • For comparison, the same module (the first three lines saved as limit.wat): wasmtime run -W max-memory-size=65536 --invoke grow limit.wat 10
Expected Results

The script passes: growing to 11 pages exceeds the 64 KiB limit, so memory.grow returns -1, as it does under wasmtime run, which prints -1.

Actual Results
result 0 didn't match
expected                 -1 / 0x00000000ffffffff
actual                    1 / 0x0000000000000001

The limit is silently ignored. -W max-table-elements behaves the same way (a table.grow past the limit succeeds under wasmtime wast and returns -1 under wasmtime run). -W fuel is applied.

Versions and Environment

Wasmtime version or commit: 50.0.1; the same code is on main (88b8d15bf0b2)

Operating system: Linux

Architecture: x86_64

Extra Info

src/commands/wast.rs configures each store with CommonOptions::configure_store, which does not install the StoreLimits that RunCommon::store_limits builds from max-memory-size, max-table-elements, max-instances and the rest. Applying those limits in wast, or rejecting the options there, would avoid the silent difference.

主要言語
Rust
スター
18.9k
フォーク
2k
平均マージ
1日 6時間
マージ済み PR(30日)
238

環境構築

はじめの一歩

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

bytecodealliance/wasmtime のほかの issue

bytecodealliance/wasmtime の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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