about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2021-05-13 18:38:25 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2021-05-13 18:38:25 +0100
commitf6a4963cc86bda5f3611f0f59e1ffe53e4b9f3fa (patch)
tree44cf734c168a994c8ec7ad541f11abea2de9b4fb
parent8220f2f2127b9aec972163ded97be7d8cff6b9a8 (diff)
downloadrust-f6a4963cc86bda5f3611f0f59e1ffe53e4b9f3fa.tar.gz
rust-f6a4963cc86bda5f3611f0f59e1ffe53e4b9f3fa.zip
Use SIGUSR1 rather than SIGTRAP for "allocated after fork"
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 (i) we want to avoid that bug rather than
trying to fix it now and (ii) it would better to use a signal that is
less at risk of strangeness.

I grepped the rust-lang/rut codebase for SIGUSR and there were no hits.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--src/test/ui/process/process-panic-after-fork.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/process/process-panic-after-fork.rs b/src/test/ui/process/process-panic-after-fork.rs
index 6e07a1611c5..5cc436c335e 100644
--- a/src/test/ui/process/process-panic-after-fork.rs
+++ b/src/test/ui/process/process-panic-after-fork.rs
@@ -46,7 +46,7 @@ impl<A> PidChecking<A> {
             let actual_pid = process::id();
             if require_pid != actual_pid {
                 unsafe {
-                    libc::raise(libc::SIGTRAP);
+                    libc::raise(libc::SIGUSR1);
                 }
             }
         }
@@ -146,5 +146,5 @@ fn main() {
 
     let status = run(&|| panic!("allocating to display... {}", DisplayWithHeap));
     dbg!(status);
-    assert_eq!(status.signal(), Some(libc::SIGTRAP));
+    assert_eq!(status.signal(), Some(libc::SIGUSR1));
 }