diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/runtime/signal-alternate-stack-cleanup.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/runtime/signal-alternate-stack-cleanup.rs')
-rw-r--r-- | src/test/ui/runtime/signal-alternate-stack-cleanup.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/test/ui/runtime/signal-alternate-stack-cleanup.rs b/src/test/ui/runtime/signal-alternate-stack-cleanup.rs deleted file mode 100644 index 8a6d73895..000000000 --- a/src/test/ui/runtime/signal-alternate-stack-cleanup.rs +++ /dev/null @@ -1,37 +0,0 @@ -// run-pass -// Previously memory for alternate signal stack have been unmapped during -// main thread exit while still being in use by signal handlers. This test -// triggers this situation by sending signal from atexit handler. -// -// ignore-wasm32-bare no libc -// ignore-windows -// ignore-sgx no libc -// ignore-vxworks no SIGWINCH in user space - -#![feature(rustc_private)] -extern crate libc; - -use libc::*; - -unsafe extern "C" fn signal_handler(signum: c_int, _: *mut siginfo_t, _: *mut c_void) { - assert_eq!(signum, SIGWINCH); -} - -extern "C" fn send_signal() { - unsafe { - raise(SIGWINCH); - } -} - -fn main() { - unsafe { - // Install signal handler that runs on alternate signal stack. - let mut action: sigaction = std::mem::zeroed(); - action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _; - action.sa_sigaction = signal_handler as sighandler_t; - sigaction(SIGWINCH, &action, std::ptr::null_mut()); - - // Send SIGWINCH on exit. - atexit(send_signal); - } -} |