]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
324798cfd58e399e20a41459d0c557f8e599c856
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From 383efe26a2a61b420d369cd2c23f03d1d690d425 Mon Sep 17 00:00:00 2001
2 From: Hongxu Jia <hongxu.jia@windriver.com>
3 Date: Mon, 28 Jul 2025 20:35:13 +0800
4 Subject: [PATCH] tests/helpers/test_sigstate.c: explicitly reset SIGINT to
5 default action after trapping
6
7 After upgrading bash to 5.3 to contain commit [1], if SIGINT was trapped in
8 asynchronous subshell, bash called set_signal_async_ignored to make sure
9 processes that are created by this asynchronous subshell to ignore SIGINT.
10
11 And it caused test case `kill/decode' failed, the signal INT was existed in
12 both of Blocked and Ignored
13
14 $ ./tests/run.sh --use-system-commands --parsable --show-diff kill/decode
15 ...
16 diff-{{{
17 |--- /usr/lib/util-linux/ptest/tests/expected/kill/decode 2011-04-05 23:00:00.000000000 +0000
18 |+++ /usr/lib/util-linux/ptest/tests/output/kill/decode 2025-07-28 12:09:46.279000000 +0000
19 @@ -16,5 +16,5 @@
20 Pending (thread): INT ILL
21 Pending (process): USR1
22 Blocked: INT ILL ABRT FPE USR1 SEGV TERM
23 -Ignored: HUP QUIT TRAP PIPE ALRM
24 +Ignored: HUP INT QUIT TRAP PIPE ALRM
25 Caught: ILL USR1
26 }}}-diff
27 ...
28
29 Explicitly reset SIGINT to default action after trapping, then the
30 test case `kill/decode' works on both of old (<5.3) and new (>=5.3) bash
31
32 [1] https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=a5d2617c7a7e602ace1f4149987cdfd075c4e762
33
34 Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3666]
35
36 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
37 ---
38 tests/helpers/test_sigstate.c | 1 +
39 1 file changed, 1 insertion(+)
40
41 diff --git a/tests/helpers/test_sigstate.c b/tests/helpers/test_sigstate.c
42 index 52c7dcb..b631ec2 100644
43 --- a/tests/helpers/test_sigstate.c
44 +++ b/tests/helpers/test_sigstate.c
45 @@ -68,6 +68,7 @@ int main(int argc _U_, char **argv _U_)
46 sigignore(SIGPIPE);
47 sigignore(SIGALRM);
48
49 + signal(SIGINT, SIG_DFL);
50 signal(SIGBUS, SIG_DFL);
51 signal(SIGFPE, SIG_DFL);
52 signal(SIGSEGV, SIG_DFL);
53 --
54 2.34.1
55