Skip to content

Commit

Permalink
Disable stack overflow handler tests on iOS-like platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed May 28, 2024
1 parent d82be82 commit 37ae2b6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ mod imp {
}
}

// This is intentionally not enabled on iOS/tvOS/watchOS/visionOS, as it uses
// several symbols that might lead to rejections from the App Store, namely
// `sigaction`, `sigaltstack`, `sysctlbyname`, `mmap`, `munmap` and `mprotect`.
//
// This might be overly cautious, though it is also what Swift does (and they
// usually have fewer qualms about forwards compatibility, since the runtime
// is shipped with the OS):
// <https://github.com/apple/swift/blob/swift-5.10-RELEASE/stdlib/public/runtime/CrashHandlerMacOS.cpp>
#[cfg(not(any(
target_os = "linux",
target_os = "freebsd",
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/abi/stack-probes-lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
//@ compile-flags: -C lto
//@ no-prefer-dynamic
//@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino
//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't

include!("stack-probes.rs");
4 changes: 4 additions & 0 deletions tests/ui/abi/stack-probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
//@ ignore-sgx no processes
//@ ignore-fuchsia no exception handler registered for segfault
//@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino
//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't

use std::env;
use std::mem::MaybeUninit;
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/runtime/out-of-stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
//@ ignore-sgx no processes
//@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
//@ ignore-nto no stack overflow handler used (no alternate stack available)
//@ ignore-ios stack overflow handlers aren't enabled
//@ ignore-tvos stack overflow handlers aren't enabled
//@ ignore-watchos stack overflow handlers aren't enabled
//@ ignore-visionos stack overflow handlers aren't enabled

#![feature(rustc_private)]

Expand Down

0 comments on commit 37ae2b6

Please sign in to comment.