diff mbox series

util-linux: correct test case kill/decode for bash 5.3

Message ID 20250728134238.3455854-1-hongxu.jia@windriver.com
State Accepted, archived
Commit 175f5a5bba6204cbcfbdeabb6c6b98f0f7453558
Headers show
Series util-linux: correct test case kill/decode for bash 5.3 | expand

Commit Message

Hongxu Jia July 28, 2025, 1:42 p.m. UTC
After upgrading bash to 5.3 to contain commit [1], if SIGINT was trapped in
asynchronous subshell, bash called set_signal_async_ignored to make sure
processes that are created by this asynchronous subshell to ignore SIGINT.

And it caused test case `kill/decode' failed, the signal INT was existed in
both of Blocked and Ignored

root@qemux86-64:~# cd /usr/lib/util-linux/ptest/
root@qemux86-64:/usr/lib/util-linux/ptest# ./run-ptest
...
diff-{{{
|--- /usr/lib/util-linux/ptest/tests/expected/kill/decode        2011-04-05 23:00:00.000000000 +0000
|+++ /usr/lib/util-linux/ptest/tests/output/kill/decode  2025-07-28 12:09:46.279000000 +0000
@@ -16,5 +16,5 @@
 Pending (thread): INT ILL
 Pending (process): USR1
 Blocked: INT ILL ABRT FPE USR1 SEGV TERM
-Ignored: HUP QUIT TRAP PIPE ALRM
+Ignored: HUP INT QUIT TRAP PIPE ALRM
 Caught: ILL USR1
}}}-diff
...

Explicitly reset SIGINT to default action after trapping, then the
test case `kill/decode' works on both of old (<5.3) and new (>=5.3) bash

[1] https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=a5d2617c7a7e602ace1f4149987cdfd075c4e762

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-core/util-linux/util-linux.inc   |  1 +
 ...st_sigstate.c-explicitly-reset-SIGIN.patch | 55 +++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/0001-tests-helpers-test_sigstate.c-explicitly-reset-SIGIN.patch

Comments

patchtest@automation.yoctoproject.org July 28, 2025, 2 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/util-linux-correct-test-case-kill-decode-for-bash-5.3.patch

FAIL: test mbox format: Series has malformed diff lines. Create the series again using git-format-patch and ensure it applies using git am (test_mbox.TestMbox.test_mbox_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: Python-unidiff parse error (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: Parse error Unexpected hunk found: @@ -16,5 +16,5 @@
SKIP: test Signed-off-by presence: Parse error Unexpected hunk found: @@ -16,5 +16,5 @@
SKIP: test Upstream-Status presence: Parse error Unexpected hunk found: @@ -16,5 +16,5 @@
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: Python-unidiff parse error (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 111f29cb928..7d6759a2c0e 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -20,6 +20,7 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
            file://0001-tests-ts-kill-decode-avoid-using-shell-built-in-kill.patch \
            file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \
            file://0001-ts-kill-decode-use-RTMIN-from-kill-L-instead-of-hard.patch \
+           file://0001-tests-helpers-test_sigstate.c-explicitly-reset-SIGIN.patch \
            "
 
 SRC_URI[sha256sum] = "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6"
diff --git a/meta/recipes-core/util-linux/util-linux/0001-tests-helpers-test_sigstate.c-explicitly-reset-SIGIN.patch b/meta/recipes-core/util-linux/util-linux/0001-tests-helpers-test_sigstate.c-explicitly-reset-SIGIN.patch
new file mode 100644
index 00000000000..324798cfd58
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/0001-tests-helpers-test_sigstate.c-explicitly-reset-SIGIN.patch
@@ -0,0 +1,55 @@ 
+From 383efe26a2a61b420d369cd2c23f03d1d690d425 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 28 Jul 2025 20:35:13 +0800
+Subject: [PATCH] tests/helpers/test_sigstate.c: explicitly reset SIGINT to
+ default action after trapping
+
+After upgrading bash to 5.3 to contain commit [1], if SIGINT was trapped in
+asynchronous subshell, bash called set_signal_async_ignored to make sure
+processes that are created by this asynchronous subshell to ignore SIGINT.
+
+And it caused test case `kill/decode' failed, the signal INT was existed in
+both of Blocked and Ignored
+
+$ ./tests/run.sh --use-system-commands --parsable --show-diff   kill/decode
+...
+diff-{{{
+|--- /usr/lib/util-linux/ptest/tests/expected/kill/decode        2011-04-05 23:00:00.000000000 +0000
+|+++ /usr/lib/util-linux/ptest/tests/output/kill/decode  2025-07-28 12:09:46.279000000 +0000
+@@ -16,5 +16,5 @@
+ Pending (thread): INT ILL
+ Pending (process): USR1
+ Blocked: INT ILL ABRT FPE USR1 SEGV TERM
+-Ignored: HUP QUIT TRAP PIPE ALRM
++Ignored: HUP INT QUIT TRAP PIPE ALRM
+ Caught: ILL USR1
+}}}-diff
+...
+
+Explicitly reset SIGINT to default action after trapping, then the
+test case `kill/decode' works on both of old (<5.3) and new (>=5.3) bash
+
+[1] https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=a5d2617c7a7e602ace1f4149987cdfd075c4e762
+
+Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3666]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/helpers/test_sigstate.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/helpers/test_sigstate.c b/tests/helpers/test_sigstate.c
+index 52c7dcb..b631ec2 100644
+--- a/tests/helpers/test_sigstate.c
++++ b/tests/helpers/test_sigstate.c
+@@ -68,6 +68,7 @@ int main(int argc _U_, char **argv _U_)
+ 	sigignore(SIGPIPE);
+ 	sigignore(SIGALRM);
+ 
++	signal(SIGINT, SIG_DFL);
+ 	signal(SIGBUS, SIG_DFL);
+ 	signal(SIGFPE, SIG_DFL);
+ 	signal(SIGSEGV, SIG_DFL);
+-- 
+2.34.1
+