Files
wasmtime/crates/fuzzing/Cargo.toml
Alex Crichton 0b4263333b Fuzz cranelift cpu flag settings with Wasmtime (#3800)
* Fuzz cranelift cpu flag settings with Wasmtime

This commit updates the `Config` fuzz-generator to consume some of the
input as configuration settings for codegen flags we pass to cranelift.
This should allow for ideally some more coverage where settings are
disabled or enabled, ideally finding possible bugs in feature-specific
implementations or generic implementations that are rarely used if the
feature-specific ones almost always take precedent.

The technique used in this commit is to weight selection of codegen
settings less frequently than using the native settings. Afterwards each
listed feature is individually enabled or disabled depending on the
input fuzz data, and if a feature is enabled but the host doesn't
actually support it then the fuzz input is rejected with a log message.
The goal here is to still have many fuzz inputs accepted but also ensure
determinism across hosts. If there's a bug specifically related to
enabling a flag then running it on a host without the flag should
indicate that the flag isn't supported rather than silently leaving it
disabled and reporting the fuzz case a success.

* Use built-in `Unstructured::ratio` method

* Tweak macro

* Bump arbitrary dep version
2022-02-15 14:27:55 -06:00

42 lines
1.4 KiB
TOML

[package]
authors = ["The Wasmtime Project Developers"]
description = "Fuzzing infrastructure for Wasmtime"
edition = "2018"
name = "wasmtime-fuzzing"
publish = false
version = "0.19.0"
license = "Apache-2.0 WITH LLVM-exception"
[dependencies]
anyhow = "1.0.22"
arbitrary = { version = "1.1.0", features = ["derive"] }
env_logger = "0.8.1"
log = "0.4.8"
rayon = "1.2.1"
target-lexicon = "0.12.3"
tempfile = "3.3.0"
wasmparser = "0.82"
wasmprinter = "0.2.32"
wasmtime = { path = "../wasmtime" }
wasmtime-wast = { path = "../wast" }
wasm-encoder = "0.6.0"
wasm-smith = "0.7.0"
wasm-spec-interpreter = { path = "./wasm-spec-interpreter" }
wasmi = "0.7.0"
# We rely on precompiled v8 binaries, but rusty-v8 doesn't have a precompiled
# binary for MinGW which is built on our CI. It does have one for Windows-msvc,
# though, so we could use that if we wanted. For now though just simplify a bit
# and don't depend on this on Windows. The same applies on s390x.
[target.'cfg(not(any(windows, target_arch = "s390x")))'.dependencies]
v8 = "0.33"
[dev-dependencies]
wat = "1.0.37"
# FIXME(#3251) should re-enable once spec interpreter won't time out
# We only build the library containing the OCaml spec interpreter if the OCaml
# toolchain is available--which is assumed here to be the case when fuzzing.
# [target.'cfg(fuzzing)'.dependencies]
# wasm-spec-interpreter = { path = "./wasm-spec-interpreter", features = ["build-libinterpret"] }