From 401a2c1956a4a17d40677efdc43d052e36eb8f82 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 14 Dec 2016 15:55:01 -0500 Subject: [PATCH] Fix test failures Signed-off-by: Anders Kaseorg --- debian/changelog | 3 + ...re-raise-the-signal-instead-of-exiti.patch | 60 +++++++++++++++++++ debian/patches/series | 2 + ...g-t-Avoid-hanging-due-to-intermediat.patch | 58 ++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 debian/patches/opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch create mode 100644 debian/patches/tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch diff --git a/debian/changelog b/debian/changelog index 2eb5cf5fd..d7d650d7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ openafs (1.8.0~pre1-2) UNRELEASED; urgency=medium * Move libtool, heimdal-multidev from Build-Depends-Indep to Build-Depends. + * debian/patches/tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch, + debian/patches/opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch + Fix test failures. -- Anders Kaseorg Wed, 14 Dec 2016 15:52:22 -0500 diff --git a/debian/patches/opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch b/debian/patches/opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch new file mode 100644 index 000000000..5d9d18958 --- /dev/null +++ b/debian/patches/opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch @@ -0,0 +1,60 @@ +From d0ce961499d72768168a98c9321c80943b9a3c75 Mon Sep 17 00:00:00 2001 +From: Anders Kaseorg +Date: Wed, 14 Dec 2016 17:52:35 -0500 +Subject: opr: ExitHandler: re-raise the signal instead of exiting with that + code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes a ‘make check’ failure introduced by commit +803d15b6aa1e65b259ba11ca30aa1afd2e12accb “vlserver: convert the vlserver +to opr softsig”: + + $ make check + … + volser/vos..............FAILED 6 + … + $ cd tests + $ ./libwrap ../lib ./runtests -o volser/vos + 1..6 + ok 1 - Successfully got security class + ok 2 - Successfully built ubik client structure + ok 3 - First address registration succeeds + ok 4 - Second address registration succeeds + ok 5 - vos output matches + Server exited with code 15 + # wanted: 0 + # seen: -1 + not ok 6 - Server exited cleanly + # Looks like you failed 1 test of 6 + +afstest_StopServer has a check for the process terminating with signal +15 (SIGTERM), but not for the process exiting with code 15. + +Change-Id: I022965ea2b5440486ea1cf562551d3bbd0516104 +--- + src/opr/softsig.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/opr/softsig.c b/src/opr/softsig.c +index 4a210ad65..469bd43e1 100644 +--- a/src/opr/softsig.c ++++ b/src/opr/softsig.c +@@ -82,6 +82,13 @@ signalHandler(void *arg) + static void + ExitHandler(int signal) + { ++ sigset_t set; ++ sigemptyset(&set); ++ sigaddset(&set, signal); ++ pthread_sigmask(SIG_UNBLOCK, &set, NULL); ++ raise(signal); ++ ++ /* Should be unreachable. */ + exit(signal); + } + +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index 46311a018..50234c541 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,5 @@ 0003-Add-dummy-exit-command-for-afsd-to-do-nothing.patch 0002-AFS_component_version_number.c-Respect-SOURCE_DATE_E.patch 0003-Catch-up-to-roken-s-rename-of-base64-symbols.patch +tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch +opr-ExitHandler-re-raise-the-signal-instead-of-exiti.patch diff --git a/debian/patches/tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch b/debian/patches/tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch new file mode 100644 index 000000000..471996dcd --- /dev/null +++ b/debian/patches/tests-opr-softsig-t-Avoid-hanging-due-to-intermediat.patch @@ -0,0 +1,58 @@ +From 62be24b3cc7ea4b422b9d89d791e8fb11e244a55 Mon Sep 17 00:00:00 2001 +From: Anders Kaseorg +Date: Wed, 14 Dec 2016 15:47:21 -0500 +Subject: tests/opr/softsig-t: Avoid hanging due to intermediate sh -c + +If the build directory happened to contain shell metacharacters, like +the ~ in /build/openafs-vb8tid/openafs-1.8.0~pre1 used by the Debian +builders, Perl was running softsig-helper via an intermediate sh -c, +which would then intercept the signals we tried to send to +softsig-helper. Use the list syntax to avoid this sh -c. + +Change-Id: I054b9c8f606e197accb414bfe3f89719255c62c4 +--- + tests/opr/softsig-t | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/tests/opr/softsig-t b/tests/opr/softsig-t +index 89e66e5df..533feb4fd 100755 +--- a/tests/opr/softsig-t ++++ b/tests/opr/softsig-t +@@ -33,8 +33,14 @@ use FindBin qw($Bin); + # Start up our test process, and send it various signals. Check that these + # signals make it to it correctly, and are reported on the command line. + my $softsig_helper = $Bin . "/softsig-helper"; +-my $pid=open(HELPER, "$softsig_helper |") +- or die "Couldn't start test helper."; ++ ++# This -dummy argument prevents Perl from putting an intermediate sh ++# -c between us and softsig-helper in the case where the build ++# directory happens to contain shell metacharacters, like the ~ in ++# /build/openafs-vb8tid/openafs-1.8.0~pre1 used by the Debian ++# builders. ++my $pid = open(HELPER, "-|", $softsig_helper, "-dummy") ++ or die "Couldn't start test helper."; + + # Wait for softsig to start up. + is(, "Ready\n"); +@@ -71,7 +77,7 @@ is($?, SIGKILL, "Helper exited on KILL signal."); + + # Check that an internal segmentation fault kills the process. + +-$pid = open(HELPER, "$softsig_helper -crash |") ++$pid = open(HELPER, "-|", $softsig_helper, "-crash") + or die "Couldn't start test helper."; + close(HELPER); + is($? & 0x7f, SIGSEGV, "Helper exited on SEGV signal."); +@@ -84,7 +90,7 @@ SKIP: { + skip("Skipping buserror test; SIGBUS constant is not defined.", 1) unless $sigbus; + + my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); +- $pid = open(HELPER, "$softsig_helper -buserror $path |") ++ $pid = open(HELPER, "-|", $softsig_helper, "-buserror", $path) + or die "Couldn't start test helper."; + close(HELPER); + is($? & 0x7f, $sigbus, "Helper exited on BUS signal."); +-- +2.11.0 + -- 2.39.5