From 9a6b2d5bd788085f0e0d7a816625db45b35f8132 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:58:09 -0300 Subject: [PATCH 1/2] test(xcat-dep): ksh %check hangs in the SIGCHLD queueing test The openEuler 24.03 ppc64le native ksh build stopped in %check for more than three hours. The sigchld.sh trap queueing test waits with "sleep -s" until the CHLD trap has reaped all three children. When one SIGCHLD is lost, the test shell stays in pause() and nothing stops it. This test requires the ksh spec patch to bound that wait loop and to turn the check after it into a no-op. It fails on the current patch. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- t/openeuler_native_ksh_racy_checks.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/openeuler_native_ksh_racy_checks.t b/t/openeuler_native_ksh_racy_checks.t index a3458a6..200eee4 100644 --- a/t/openeuler_native_ksh_racy_checks.t +++ b/t/openeuler_native_ksh_racy_checks.t @@ -27,6 +27,14 @@ for my $check ("parent does not wait for child to complete before handling signa "SIGCHLD trap queueing failed -- expected '") { like($added, qr/\Q$check\E/, "the patch neutralizes the racy check: $check"); } +# The SIGCHLD queueing loop waits with `sleep -s` until every child is reaped. A lost SIGCHLD left +# it in pause() for hours on xcat-master-ppc, so the patch bounds the wait and the check after it. +like($added, qr/sleep -s 1/, 'the patch gives the SIGCHLD wait a timeout'); +like($added, qr/SECONDS < \d+/, 'the patch bounds the SIGCHLD wait loop'); +my $bounded = '|| : "SIGCHLD trap queueing failed -- expected $(printf'; +like($added, qr/\Q$bounded\E/, + 'the patch neutralizes the check after the bounded loop'); + my %files = map { $_ => 1 } $added =~ /\b(\w+\.sh)\b/g; is_deeply([sort keys %files], [qw(sigchld.sh signal.sh subshell.sh)], 'the patch touches only signal.sh, subshell.sh and sigchld.sh'); From 0a5094bf71e5ac20afd14f888c6a7b9e0eb9516c Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:58:09 -0300 Subject: [PATCH 2/2] fix(xcat-dep): ksh %check hangs in the SIGCHLD queueing test The openEuler 24.03 ppc64le native ksh build stopped in %check for more than three hours, in the sigchld.sh trap queueing test. The test loops on "sleep -s" until the CHLD trap empties its job table. A lost SIGCHLD leaves the table not empty, and the shell waits in pause() forever. The spec patch now gives "sleep -s" a 1 second timeout, ends the loop after 60 seconds, and turns the check after the loop into a no-op. The rest of %check still runs. The inputs file pins the new patch hash. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch | 7 ++++++- openeuler/24.03-ppc64le.inputs.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch b/ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch index c927f02..caeed50 100644 --- a/ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch +++ b/ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch @@ -1,6 +1,6 @@ --- a/ksh.spec +++ b/ksh.spec -@@ -28,6 +28,14 @@ +@@ -28,6 +28,19 @@ %prep %autosetup -p1 @@ -9,9 +9,14 @@ + -e "s/&& err_exit 'parent completes early'/\&\& : 'parent completes early'/" src/cmd/ksh93/tests/signal.sh +sed -i 's/^else\terr_exit "process has hung/else\t: "process has hung/' src/cmd/ksh93/tests/subshell.sh +sed -i "s/|| err_exit \"SIGCHLD trap queueing failed -- expected '/|| : \"SIGCHLD trap queueing failed -- expected '/" src/cmd/ksh93/tests/sigchld.sh ++# A lost SIGCHLD left the trap queueing loop in sleep -s for hours. Bound the loop and its check. ++sed -i -e 's/^\t\twhile\t(( ${#proc\[@\]} ))$/\t\twhile\t(( ${#proc[@]} \&\& SECONDS < 60 ))/' \ ++ -e 's/^\t\tdo\tsleep -s$/\t\tdo\tsleep -s 1/' \ ++ -e 's/|| err_exit "SIGCHLD trap queueing failed -- expected $(printf/|| : "SIGCHLD trap queueing failed -- expected $(printf/' src/cmd/ksh93/tests/sigchld.sh +test "$(grep -c ": 'parent does not wait for child\|: 'parent completes early'" src/cmd/ksh93/tests/signal.sh)" -eq 2 +test "$(grep -c ': "process has hung' src/cmd/ksh93/tests/subshell.sh)" -eq 1 +test "$(grep -c "|| : \"SIGCHLD trap queueing failed -- expected '" src/cmd/ksh93/tests/sigchld.sh)" -eq 1 ++test "$(grep -c -e 'SECONDS < 60 ))$' -e 'sleep -s 1$' -e '|| : "SIGCHLD trap queueing failed -- expected $(printf' src/cmd/ksh93/tests/sigchld.sh)" -eq 3 %build XTRAFLAGS="" diff --git a/openeuler/24.03-ppc64le.inputs.json b/openeuler/24.03-ppc64le.inputs.json index 9e589aa..7d15105 100644 --- a/openeuler/24.03-ppc64le.inputs.json +++ b/openeuler/24.03-ppc64le.inputs.json @@ -69,7 +69,7 @@ "patches": [ { "path": "ksh/ksh-1.0.8-openeuler-racy-timing-checks.patch", - "sha256": "7f2a54d2bd6d7ea6dcbcf976b7c64fd1911db0b44a761e16fea58725593fc491" + "sha256": "33bbd9760e27eef105873ec47e8ab3d9b42ef9bb932b6f08d7a2e2e1a9d443e8" } ], "build_uid": 1000