Element segment expressions are evaluated interleaved with table writes during instantiation
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 24/100
Línea de trabajo
Reproduce both snippets with cargo run -- wast foo.wast, then follow the module-instantiation path in the wasmtime crate to where element segment expressions are evaluated and active segments run table.init. The spec order (all expressions evaluated first, then table writes) has to be reflected there, and the change must keep the fast path for the common case. Done when both scripts trap as expected and imported tables are untouched after the trap; run the existing wast spec tests for element segments and tables.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This test:
(module $M
(type $t (func (result i32)))
(table (export "t") 2 funcref)
(table (export "a") 2 anyref)
(func (export "call") (param i32) (result i32)
(call_indirect (type $t) (local.get 0)))
(func (export "get-a") (param i32) (result i32)
(i31.get_s (ref.cast (ref i31) (table.get 1 (local.get 0))))))
(register "M" $M)
(assert_trap
(module
(type $a (array (mut i64)))
(import "M" "t" (table 2 funcref))
(table $t2 1 anyref)
(func $f (result i32) (i32.const 7))
(elem (table 0) (i32.const 0) func $f)
(elem (table $t2) (i32.const 0) anyref
(array.new_default $a (i32.const 0x7fffffff))))
"allocation size too large")
(assert_trap (invoke $M "call" (i32.const 0)) "uninitialized element")
fails with:
$ cargo run -- wast foo.wast
Error: failed to run script file 'foo.wast'
Caused by:
0: failed directive on foo.wast:21
1: expected trap, got Core([I32(7)])
and the same with the trap in a later element of the same segment:
(assert_trap
(module
(type $a (array (mut i64)))
(import "M" "a" (table 2 anyref))
(elem (table 0) (i32.const 0) anyref
(ref.i31 (i32.const 5))
(array.new_default $a (i32.const 0x7fffffff))))
"allocation size too large")
(assert_trap (invoke $M "get-a" (i32.const 0)) "null reference")
$ cargo run -- wast foo.wast
Error: failed to run script file 'foo.wast'
Caused by:
0: failed directive on foo.wast:19
1: expected trap, got Core([I32(5)])
The spec's instantiation evaluates the element expressions of every segment before running any active segment's table.init, so a trapping expression should leave imported tables untouched.
Fixing this in my opinion is going to need to be balanced with implementation complexity. This is a vanishingly niche use case which in theory shouldn't come along with a large implementation burden. Nevertheless I figured it's worth opening here.
- Lenguaje dominante
- Rust
- Estrellas
- 18.8k
- Forks
- 1.9k
- Merge medio
- 23 h 31 min
- PR fusionados (30 d)
- 410
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bytecodealliance/wasmtime
-
bug wasm-proposal:exceptions wasmtime:debugging
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bytecodealliance/wasmtime#14102 ·
Los mantenedores suelen responder en 1 día
-
wasm-proposal:gc
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bytecodealliance/wasmtime#13808 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
wasm-proposal:component-model wasm-proposal:gc
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
bytecodealliance/wasmtime#15081 ·
Los mantenedores suelen responder en 1 día
-
wasm-proposal:component-model wasm-proposal:gc
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bytecodealliance/wasmtime#15080 ·
Los mantenedores suelen responder en 1 día
-
bug cranelift
Dificultad 4/5 1-2 días Aptitud para principiantes 55/100
bytecodealliance/wasmtime#15057 ·
Los mantenedores suelen responder en 1 día
Todos los issues de bytecodealliance/wasmtime
Issues similares
-
priority middle
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
KATO-Hiro/AtCoderClans#12940 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hurttlocker/o8#5112 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día