about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2024-05-16 12:58:09 +0200
committerMads Marquart <mads@marquart.dk>2024-05-28 12:31:12 +0200
commit37ae2b68b1631a5f2cb7d2b2f6478acba654d651 (patch)
tree7da2b6eb44256ea6030c31714f922f590f37c2ee
parentd82be822a84c6e511cfb586827d0f100290f6581 (diff)
downloadrust-37ae2b68b1631a5f2cb7d2b2f6478acba654d651.tar.gz
rust-37ae2b68b1631a5f2cb7d2b2f6478acba654d651.zip
Disable stack overflow handler tests on iOS-like platforms
-rw-r--r--library/std/src/sys/pal/unix/stack_overflow.rs8
-rw-r--r--tests/ui/abi/stack-probes-lto.rs4
-rw-r--r--tests/ui/abi/stack-probes.rs4
-rw-r--r--tests/ui/runtime/out-of-stack.rs4
4 files changed, 20 insertions, 0 deletions
diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs
index 26c49257ad0..2e5bd85327a 100644
--- a/library/std/src/sys/pal/unix/stack_overflow.rs
+++ b/library/std/src/sys/pal/unix/stack_overflow.rs
@@ -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",
diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs
index 5451b72d979..70343b0599a 100644
--- a/tests/ui/abi/stack-probes-lto.rs
+++ b/tests/ui/abi/stack-probes-lto.rs
@@ -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");
diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs
index 32d4d6cd31e..22304257593 100644
--- a/tests/ui/abi/stack-probes.rs
+++ b/tests/ui/abi/stack-probes.rs
@@ -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;
diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs
index a62398df8b8..c5300635ad9 100644
--- a/tests/ui/runtime/out-of-stack.rs
+++ b/tests/ui/runtime/out-of-stack.rs
@@ -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)]