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

Aperta
#15,476 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust, wasm
Ambito
backend, testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
18.9k
Fork
2k
Merge medio
1g 6h
PR unite (30g)
238

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/wasmtime

Tutte le issue di bytecodealliance/wasmtime

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.