Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make more of the test suite run on Mac Catalyst #125226

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable stack overflow handler tests on iOS-like platforms
  • Loading branch information
madsmtm committed May 28, 2024
commit 37ae2b68b1631a5f2cb7d2b2f6478acba654d651
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>
Comment on lines +494 to +501
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And based on the exclusion notes on the stack-probes.rs test, we still emit binaries with __stack_chk_guard and such, right? And so do they? So it's less about whether the stack is protected and more about the error message.

Copy link
Contributor Author

@madsmtm madsmtm May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure Swift also emit stack probes (dubbed "stack protectors"), this is indeed only about the error message

#[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
madsmtm marked this conversation as resolved.
Show resolved Hide resolved

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