Skip to content

Commit

Permalink
fix: use unix signal handlers instead of Mach ports (#2037)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Stebalien authored Sep 12, 2024
1 parent ed50074 commit 122a9ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fvm/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result<wasmtime::Config> {
// todo(M2): make sure this is guaranteed to run in linear time.
c.cranelift_opt_level(Speed);

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

Ok(c)
}

Expand Down

0 comments on commit 122a9ac

Please sign in to comment.