From df5480057c2994914e22bd14b169dbcd8857485a Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Sun, 12 Apr 2020 22:28:29 -0500 Subject: [PATCH] tests: Skip SIGBUS test on FreeBSD Currently, 'softsig-helper -buserror' causes a SIGBUS on most platforms, but can result in SIGSEGV on FreeBSD by default (at least on 11.3-RELEASE). Skip the test on FreeBSD, until we can provide a more reliable way to generate SIGBUS. Note that when the sysctl machdep.prot_fault_translation is set to 1, 'softsig-helper -buserror' generates a SIGBUS instead of SIGSEGV, suggesting that generating a SIGBUS here is the old 'compat' behavior. When machdep.prot_fault_translation is 0 (the default), the code path in the FreeBSD kernel that dictates whether to send a SIGBUS or SIGSEGV in this situation depends on some autodetection heuristics, and so may produce different results depending on FreeBSD releases or even compiler settings (due to detection of ABI based on some ELF notes in the relevant binary). For some details on this sysctl, see or the FreeBSD source code. In 11.3-RELEASE, the decision to issue a SIGBUS or SIGSEGV can be found around sys/amd64/amd64/trap.c:355. Change-Id: Ib75b43cc12302532ee87a3744fc364424f2a3ca6 Reviewed-on: https://gerrit.openafs.org/14145 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- tests/opr/softsig-t | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/opr/softsig-t b/tests/opr/softsig-t index a0d0fce7ae..2932edc148 100755 --- a/tests/opr/softsig-t +++ b/tests/opr/softsig-t @@ -98,6 +98,7 @@ is($? & 0x7f, SIGSEGV, "Helper exited on SEGV signal."); SKIP: { my $sigbus = eval "SIGBUS"; skip("Skipping buserror test; SIGBUS constant is not defined.", 1) unless $sigbus; + skip("Skipping buserror test; test unreliable on FreeBSD.", 1) if ($^O eq 'freebsd'); my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); $pid = open(HELPER, "-|", $softsig_helper, "-buserror", $path)