Add differential fuzzing against V8 (#3264)

* Add differential fuzzing against V8

This commit adds a differential fuzzing target to Wasmtime along the
lines of the wasmi and spec interpreters we already have, but with V8
instead. The intention here is that wasmi is unlikely to receive updates
over time (e.g. for SIMD), and the spec interpreter is not suitable for
fuzzing against in general due to its performance characteristics. The
hope is that V8 is indeed appropriate to fuzz against because it's
naturally receiving updates and it also is expected to have good
performance.

Here the `rusty_v8` crate is used which provides bindings to V8 as well
as precompiled binaries by default. This matches exactly the use case we
need and at least for now I think the `rusty_v8` crate will be
maintained by the Deno folks as they continue to develop it. If it
becomes an issue though maintaining we can evaluate other options to
have differential fuzzing against.

For now this commit enables the SIMD and bulk-memory feature of
fuzz-target-generation which should enable them to get
differentially-fuzzed with V8 in addition to the compilation fuzzing
we're already getting.

* Use weak linkage for GDB jit helpers

This should help us deduplicate our symbol with other JIT runtimes, if
any. For now this leans on some C helpers to define the weak linkage
since Rust doesn't support that on stable yet.

* Don't use rusty_v8 on MinGW

They don't have precompiled libraries there.

* Fix msvc build

* Comment about execution
This commit is contained in:
Alex Crichton
2021-08-31 09:34:55 -05:00
committed by GitHub
parent ef3ec594ce
commit 4376cf2609
10 changed files with 432 additions and 38 deletions

35
Cargo.lock generated
View File

@@ -1274,6 +1274,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "fslock"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbc585f4fe7227b37ef0216444c87ca8ab6051622e4e2bc75d4bed4ea5106148"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "fst"
version = "0.4.6"
@@ -2649,6 +2659,19 @@ dependencies = [
"wait-timeout",
]
[[package]]
name = "rusty_v8"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fc062fb861b82fa7ac4e1a009da873279a10180d2133574e4219d870038c1c"
dependencies = [
"bitflags",
"fslock",
"lazy_static",
"libc",
"which",
]
[[package]]
name = "ryu"
version = "1.0.5"
@@ -3739,6 +3762,7 @@ dependencies = [
"env_logger 0.8.3",
"log",
"rayon",
"rusty_v8",
"wasm-encoder",
"wasm-smith",
"wasm-spec-interpreter",
@@ -3905,6 +3929,17 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "which"
version = "4.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9"
dependencies = [
"either",
"lazy_static",
"libc",
]
[[package]]
name = "wiggle"
version = "0.29.0"