]> git.lizzy.rs Git - rust.git/commitdiff
Tolerate SIGTRAP for panic abort after panic::always_abort
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 13 May 2021 17:41:18 +0000 (18:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 13 May 2021 17:42:52 +0000 (18:42 +0100)
Some platforma (eg ARM64) apparently generate SIGTRAP for panic abort!

See eg
  https://github.com/rust-lang/rust/pull/81858#issuecomment-840702765

This is probably a bug, but we don't want to entangle this MR with it.
When it's fixed, this commit should be reverted.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
library/std/src/sys/unix/process/process_unix/tests.rs
src/test/ui/process/process-panic-after-fork.rs

index d7915d81ebdec3fd1a28f872192b10b6c95170d3..157debf2d257b5a1a9e4bcc9b8fbd44bb8052257 100644 (file)
@@ -53,5 +53,5 @@ fn test_command_fork_no_unwind() {
     let status = got.expect("panic unexpectedly propagated");
     dbg!(status);
     let signal = status.signal().expect("expected child process to die of signal");
-    assert!(signal == libc::SIGABRT || signal == libc::SIGILL);
+    assert!(signal == libc::SIGABRT || signal == libc::SIGILL || signal == libc::SIGTRAP);
 }
index 5cc436c335edd6881bd48c96959e2a45ad4ee1de..f178baefcf621a7c67b984af95f83b9f0449d154 100644 (file)
@@ -78,7 +78,7 @@ unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut
 fn expect_aborted(status: ExitStatus) {
     dbg!(status);
     let signal = status.signal().expect("expected child process to die of signal");
-    assert!(signal == libc::SIGABRT || signal == libc::SIGILL);
+    assert!(signal == libc::SIGABRT || signal == libc::SIGILL || signal == libc::SIGTRAP);
 }
 
 fn main() {