Disable cranelift's verifier by default (#882)

The intention of the `wasmtime` crate was to disable this verifier by
default, but it looks like cranelift actually has it turned on by
default which was making our documentation incorrect!

This was discovered by seeing a number of timeouts when fuzzing. The
debug verifier is great for fuzzing, however, so fuzzing is updated to
enable this unconditionally, meaning we'll still have timeouts. For
general users though this should make the documentation correct that the
`wasmtime` crate, by default, disables the debug verifier.
This commit is contained in:
Alex Crichton
2020-02-06 12:04:53 -06:00
committed by GitHub
parent 8e0651374a
commit c860edc14f
2 changed files with 13 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ use wasmtime::*;
pub fn instantiate(wasm: &[u8], strategy: Strategy) {
let mut config = Config::new();
config
.cranelift_debug_verifier(true)
.strategy(strategy)
.expect("failed to enable lightbeam");
instantiate_with_config(wasm, config);
@@ -70,7 +71,10 @@ pub fn instantiate_with_config(wasm: &[u8], config: Config) {
/// You can control which compiler is used via passing a `Strategy`.
pub fn compile(wasm: &[u8], strategy: Strategy) {
let mut config = Config::new();
config.strategy(strategy).unwrap();
config
.cranelift_debug_verifier(true)
.strategy(strategy)
.unwrap();
let engine = Engine::new(&config);
let store = Store::new(&engine);
let _ = Module::new(&store, wasm);
@@ -264,7 +268,9 @@ pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
match call {
ApiCall::ConfigNew => {
assert!(config.is_none());
config = Some(Config::new());
let mut cfg = Config::new();
cfg.cranelift_debug_verifier(true);
config = Some(cfg);
}
ApiCall::ConfigDebugInfo(b) => {