Skip to content

Commit f6a4963

Browse files
committed
Use SIGUSR1 rather than SIGTRAP for "allocated after fork"
Some platforma (eg ARM64) apparently generate SIGTRAP for panic abort! See eg #81858 (comment) 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 <[email protected]>
1 parent 8220f2f commit f6a4963

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/ui/process/process-panic-after-fork.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<A> PidChecking<A> {
4646
let actual_pid = process::id();
4747
if require_pid != actual_pid {
4848
unsafe {
49-
libc::raise(libc::SIGTRAP);
49+
libc::raise(libc::SIGUSR1);
5050
}
5151
}
5252
}
@@ -146,5 +146,5 @@ fn main() {
146146

147147
let status = run(&|| panic!("allocating to display... {}", DisplayWithHeap));
148148
dbg!(status);
149-
assert_eq!(status.signal(), Some(libc::SIGTRAP));
149+
assert_eq!(status.signal(), Some(libc::SIGUSR1));
150150
}

0 commit comments

Comments
 (0)