Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

fuzz: Update `wasmi` to v0.51.1 (#11946)

Saúl Cabrera1ec5a225d0ea
diff --git a/Cargo.lock b/Cargo.lock
index 494539f121..e5729616e8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -147,12 +147,6 @@ dependencies = [
"arbitrary",
]
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
[[package]]
name = "async-trait"
version = "0.1.89"
@@ -1199,12 +1193,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "downcast-rs"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf"
-
[[package]]
name = "easy-smt"
version = "0.2.2"
@@ -2441,12 +2429,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "multi-stash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f"
-
[[package]]
name = "mutatis"
version = "0.3.2"
@@ -4458,53 +4440,49 @@ dependencies = [
[[package]]
name = "wasmi"
-version = "0.43.1"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cd93c135ccbe88cfd00992c9c49778d364417bdb5cfb360eac60fe2d4d34676"
+checksum = "cb4f6b71d5cb04a4615b9a8a2e522ba284c491ad847afd9e905d89be15e3efc0"
dependencies = [
- "arrayvec",
- "multi-stash",
- "smallvec",
"spin",
"wasmi_collections",
"wasmi_core",
"wasmi_ir",
- "wasmparser 0.227.1",
+ "wasmparser 0.228.0",
]
[[package]]
name = "wasmi_collections"
-version = "0.43.1"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55e817a9a96149aa3ddb84c44c6fe37ed608d53136d794d4d3cd8019de11fb42"
+checksum = "6a4a11fa090c4d742e5a77dbbc8efbbe1aa151db7335ca6850232e6cafbb1023"
dependencies = [
"string-interner",
]
[[package]]
name = "wasmi_core"
-version = "0.43.1"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24f5adb8c394f8fb66653ce0a00e3a109fed285f3351a4b5854c1300ac8d3b20"
+checksum = "ab3e422fc1f4df78c9ded6ed48c4ca6d1f55f4609f04c99962fc07532e4db61d"
dependencies = [
- "downcast-rs",
"libm",
]
[[package]]
name = "wasmi_ir"
-version = "0.43.1"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e532ea88ccdbe2889ed3c00a8733971e1160c9a73a4dcee2fdec47fb3ee8ba4"
+checksum = "13fe9f9f1747ec81644e764c4dc798f063f5d54a495f0a3b4a375bce9af65399"
dependencies = [
"wasmi_core",
]
[[package]]
name = "wasmparser"
-version = "0.227.1"
+version = "0.228.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2"
+checksum = "4abf1132c1fdf747d56bbc1bb52152400c70f336870f968b85e89ea422198ae3"
dependencies = [
"bitflags 2.9.4",
"indexmap 2.11.4",
diff --git a/crates/fuzzing/Cargo.toml b/crates/fuzzing/Cargo.toml
index b4bfca7785..8f9f53b876 100644
--- a/crates/fuzzing/Cargo.toml
+++ b/crates/fuzzing/Cargo.toml
@@ -32,7 +32,7 @@ wasm-encoder = { workspace = true }
wasm-smith = { workspace = true, features = ['serde'] }
wasm-mutate = { workspace = true }
wasm-spec-interpreter = { path = "./wasm-spec-interpreter", optional = true }
-wasmi = { version = "0.43.1", default-features = false, features = ["std", "simd"] }
+wasmi = { version = "0.51.1", default-features = false, features = ["std", "simd"] }
futures = { workspace = true }
wasmtime-test-util = { workspace = true, features = ['wast', 'component-fuzz', 'component'] }
serde_json = { workspace = true }
diff --git a/crates/fuzzing/src/oracles/diff_wasmi.rs b/crates/fuzzing/src/oracles/diff_wasmi.rs
index dbed7f2f27..a34ede0136 100644
--- a/crates/fuzzing/src/oracles/diff_wasmi.rs
+++ b/crates/fuzzing/src/oracles/diff_wasmi.rs
@@ -19,15 +19,6 @@ impl WasmiEngine {
config.exceptions_enabled = false;
config.gc_enabled = false;
- // FIXME: once the active fuzz bug for wasmi's simd differential fuzzing
- // has been fixed and we've updated then this should be re-enabled.
- config.simd_enabled = false;
- // FIXME: requires updating to a wasmi that contains
- // wasmi-labs/wasmi#1531.
- config.memory64_enabled = false;
- // FIXME: until https://github.com/wasmi-labs/wasmi/issues/1544 is fixed.
- config.wide_arithmetic_enabled = false;
-
let mut wasmi_config = wasmi::Config::default();
wasmi_config
.consume_fuel(false)
@@ -81,8 +72,7 @@ impl DiffEngine for WasmiEngine {
wasmi::Module::new(&self.engine, wasm).context("unable to validate Wasm module")?;
let mut store = wasmi::Store::new(&self.engine, ());
let instance = wasmi::Linker::<()>::new(&self.engine)
- .instantiate(&mut store, &module)
- .and_then(|i| i.start(&mut store))
+ .instantiate_and_start(&mut store, &module)
.context("unable to instantiate module in wasmi")?;
Ok(Box::new(WasmiInstance { store, instance }))
}
@@ -187,11 +177,11 @@ impl From<&DiffValue> for wasmi::Val {
DiffValue::V128(n) => WasmiValue::V128(wasmi::core::V128::from(n)),
DiffValue::FuncRef { null } => {
assert!(null);
- WasmiValue::FuncRef(wasmi::FuncRef::null())
+ WasmiValue::default(wasmi::ValType::FuncRef)
}
DiffValue::ExternRef { null } => {
assert!(null);
- WasmiValue::ExternRef(wasmi::ExternRef::null())
+ WasmiValue::default(wasmi::ValType::ExternRef)
}
DiffValue::AnyRef { .. } => unimplemented!(),
DiffValue::ExnRef { .. } => unimplemented!(),