Skip to content

Commit

Permalink
[v2] fix: use unix signal handlers instead of Mach ports (#2042)
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 committed Sep 12, 2024
1 parent 4777600 commit 9213fcf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fvm/src/machine/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ pub fn default_wasmtime_config() -> 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);

c
}

Expand Down

0 comments on commit 9213fcf

Please sign in to comment.