Stebalien labeled issue #4350:
- In wasmtime 0.38.1, disabling stack tracing results in a
setting "unwind_info" is configured to Bool(false) which is not supported
due to https://github.com/bytecodealliance/wasmtime/blob/9e2adfb34531610d691f74dd3f559bc5b800eb02/crates/wasmtime/src/engine.rs#L325.- On master, backtraces can be disabled, but cranelift's "unwind_info" isn't set to false (it just isn't set). This is making one of our tests 1000x slower (0.12 seconds to 120 seconds).
I can fix this with:
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index b41ae9396..256009a0a 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -1423,6 +1423,10 @@ impl Config { { bail!("compiler option 'unwind_info' must be enabled when either 'backtraces' or 'reference types' are enabled"); } + } else { + unsafe { + self.cranelift_flag_set("unwind_info", "false"); + } } if self.features.reference_types { if !self diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs index 9dd637e71..83514d72c 100644 --- a/crates/wasmtime/src/engine.rs +++ b/crates/wasmtime/src/engine.rs @@ -345,7 +345,7 @@ impl Engine { // can affect the way the generated code performs or behaves at // runtime. "avoid_div_traps" => *value == FlagValue::Bool(true), - "unwind_info" => *value == FlagValue::Bool(true), + "unwind_info" => true, "libcall_call_conv" => *value == FlagValue::Enum("isa_default".into()), // Features wasmtime doesn't use should all be disabled, since
But I'm wondering if:
- The other settings (reference types, simd) need to be explicitly set as well.
- There's a bad default somewhere. Should
unwind_info
be disabled by default in cranelift?
Stebalien opened issue #4350:
- In wasmtime 0.38.1, disabling stack tracing results in a
setting "unwind_info" is configured to Bool(false) which is not supported
due to https://github.com/bytecodealliance/wasmtime/blob/9e2adfb34531610d691f74dd3f559bc5b800eb02/crates/wasmtime/src/engine.rs#L325.- On master, backtraces can be disabled, but cranelift's "unwind_info" isn't set to false (it just isn't set). This is making one of our tests 1000x slower (0.12 seconds to 120 seconds).
I can fix this with:
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index b41ae9396..256009a0a 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -1423,6 +1423,10 @@ impl Config { { bail!("compiler option 'unwind_info' must be enabled when either 'backtraces' or 'reference types' are enabled"); } + } else { + unsafe { + self.cranelift_flag_set("unwind_info", "false"); + } } if self.features.reference_types { if !self diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs index 9dd637e71..83514d72c 100644 --- a/crates/wasmtime/src/engine.rs +++ b/crates/wasmtime/src/engine.rs @@ -345,7 +345,7 @@ impl Engine { // can affect the way the generated code performs or behaves at // runtime. "avoid_div_traps" => *value == FlagValue::Bool(true), - "unwind_info" => *value == FlagValue::Bool(true), + "unwind_info" => true, "libcall_call_conv" => *value == FlagValue::Enum("isa_default".into()), // Features wasmtime doesn't use should all be disabled, since
But I'm wondering if:
- The other settings (reference types, simd) need to be explicitly set as well.
- There's a bad default somewhere. Should
unwind_info
be disabled by default in cranelift?
pchickey commented on issue #4350:
Thanks for the bug report, please send a PR and we'll merge the fix. The diff in engine.rs should be moving the
"unwind_info"
case down to the section starting at line 375.
alexcrichton closed issue #4350:
- In wasmtime 0.38.1, disabling stack tracing results in a
setting "unwind_info" is configured to Bool(false) which is not supported
due to https://github.com/bytecodealliance/wasmtime/blob/9e2adfb34531610d691f74dd3f559bc5b800eb02/crates/wasmtime/src/engine.rs#L325.- On master, backtraces can be disabled, but cranelift's "unwind_info" isn't set to false (it just isn't set). This is making one of our tests 1000x slower (0.12 seconds to 120 seconds).
I can fix this with:
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index b41ae9396..256009a0a 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -1423,6 +1423,10 @@ impl Config { { bail!("compiler option 'unwind_info' must be enabled when either 'backtraces' or 'reference types' are enabled"); } + } else { + unsafe { + self.cranelift_flag_set("unwind_info", "false"); + } } if self.features.reference_types { if !self diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs index 9dd637e71..83514d72c 100644 --- a/crates/wasmtime/src/engine.rs +++ b/crates/wasmtime/src/engine.rs @@ -345,7 +345,7 @@ impl Engine { // can affect the way the generated code performs or behaves at // runtime. "avoid_div_traps" => *value == FlagValue::Bool(true), - "unwind_info" => *value == FlagValue::Bool(true), + "unwind_info" => true, "libcall_call_conv" => *value == FlagValue::Enum("isa_default".into()), // Features wasmtime doesn't use should all be disabled, since
But I'm wondering if:
- The other settings (reference types, simd) need to be explicitly set as well.
- There's a bad default somewhere. Should
unwind_info
be disabled by default in cranelift?
Last updated: Dec 23 2024 at 12:05 UTC