Skip to content

Commit 89a6ade

Browse files
authored
fix: use unix signal handlers instead of Mach ports (#2036)
This will apparently interfere with some debugging tools, but we ran into an issue where Mach ports weren't always catching illegal instruction signals form wasmtime (affecting macos only).
1 parent 1e31330 commit 89a6ade

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fvm/src/engine/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result<wasmtime::Config> {
247247
// todo(M2): make sure this is guaranteed to run in linear time.
248248
c.cranelift_opt_level(Speed);
249249

250+
// Use traditional unix signal handlers instead of Mach ports on MacOS. The Mach ports signal
251+
// handlers don't appear to be capturing all SIGILL signals (when run under lotus) and we're not
252+
// entirely sure why. Upstream documentation indicates that this could be due to the use of
253+
// `fork`, but we're only using threads, not subprocesses.
254+
//
255+
// The downside to using traditional signal handlers is that this may interfere with some
256+
// debugging tools. But we'll just have to live with that.
257+
c.macos_use_mach_ports(false);
258+
250259
Ok(c)
251260
}
252261

0 commit comments

Comments
 (0)