2 // Previously memory for alternate signal stack have been unmapped during
3 // main thread exit while still being in use by signal handlers. This test
4 // triggers this situation by sending signal from atexit handler.
6 // ignore-cloudabi no signal handling support
7 // ignore-wasm32-bare no libc
10 // ignore-vxworks no SIGWINCH in user space
12 #![feature(rustc_private)]
17 unsafe extern fn signal_handler(signum: c_int, _: *mut siginfo_t, _: *mut c_void) {
18 assert_eq!(signum, SIGWINCH);
21 extern fn send_signal() {
29 // Install signal handler that runs on alternate signal stack.
30 let mut action: sigaction = std::mem::zeroed();
31 action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _;
32 action.sa_sigaction = signal_handler as sighandler_t;
33 sigaction(SIGWINCH, &action, std::ptr::null_mut());
35 // Send SIGWINCH on exit.