summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2025-06-05 11:42:10 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-12 11:03:43 +0100
commite8aa0ee654c9809006d2af4b49ff43c10ccc6aef (patch)
treedfa591a78ff84072498ee1a3f275af10c27cb9c0
parent3580f89b066a42f60acf5636dd6572dd4ec0d871 (diff)
downloadpoky-e8aa0ee654c9809006d2af4b49ff43c10ccc6aef.tar.gz
util-linux: fix ptest failure for musl
The kill/decode test case fails for musl. The root cause is the test case only considers glibc and uses 34 as SIGRTMIN while musl uses 35. Add patches to fix this issue. (From OE-Core rev: 0a1dd5f04a843dfa0b1fc3ce0069e26bd0fbc48e) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc2
-rw-r--r--meta/recipes-core/util-linux/util-linux/0001-test_sysinfo.c-print-out-SIGRTMIN.patch50
-rw-r--r--meta/recipes-core/util-linux/util-linux/0002-ts-kill-decode-use-SIGRTMIN-from-test_sysinfo-instea.patch56
3 files changed, 108 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index b0f2a9d497..fc5add37ac 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -42,6 +42,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
42 file://fcntl-lock.c \ 42 file://fcntl-lock.c \
43 file://0001-tests-ts-kill-decode-avoid-using-shell-built-in-kill.patch \ 43 file://0001-tests-ts-kill-decode-avoid-using-shell-built-in-kill.patch \
44 file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \ 44 file://0001-lsfd-mkfds-foreign-sockets-skip-when-lacking-sock_di.patch \
45 file://0001-test_sysinfo.c-print-out-SIGRTMIN.patch \
46 file://0002-ts-kill-decode-use-SIGRTMIN-from-test_sysinfo-instea.patch \
45 " 47 "
46 48
47SRC_URI[sha256sum] = "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6" 49SRC_URI[sha256sum] = "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6"
diff --git a/meta/recipes-core/util-linux/util-linux/0001-test_sysinfo.c-print-out-SIGRTMIN.patch b/meta/recipes-core/util-linux/util-linux/0001-test_sysinfo.c-print-out-SIGRTMIN.patch
new file mode 100644
index 0000000000..ee9f220842
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/0001-test_sysinfo.c-print-out-SIGRTMIN.patch
@@ -0,0 +1,50 @@
1From 50774e34fee0cd528b195a863bcd4e3a04fbfc4b Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jun 2025 10:52:18 +0800
4Subject: [PATCH 1/2] test_sysinfo.c: print out SIGRTMIN
5
6This will be used by ts/kill/decode.
7
8Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3605]
9
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11---
12 tests/helpers/test_sysinfo.c | 8 ++++++++
13 1 file changed, 8 insertions(+)
14
15diff --git a/tests/helpers/test_sysinfo.c b/tests/helpers/test_sysinfo.c
16index 1559d471f..3a791e7f1 100644
17--- a/tests/helpers/test_sysinfo.c
18+++ b/tests/helpers/test_sysinfo.c
19@@ -27,6 +27,7 @@
20 #include <errno.h>
21 #include <time.h>
22 #include <sys/ioctl.h>
23+#include <signal.h>
24
25 #include "c.h"
26
27@@ -116,6 +117,12 @@ static int hlp_ulong_max32(void)
28 return 0;
29 }
30
31+static int hlp_sigrtmin(void)
32+{
33+ printf("%d\n", SIGRTMIN);
34+ return 0;
35+}
36+
37 static int hlp_wcsspn_ok(void)
38 {
39 printf("%d\n", wcsspn(L"FOO", L"F") == 1);
40@@ -229,6 +236,7 @@ static const mntHlpfnc hlps[] =
41 { "ULONG_MAX", hlp_ulong_max },
42 { "ULONG_MAX32",hlp_ulong_max32 },
43 { "UINT64_MAX", hlp_u64_max },
44+ { "SIGRTMIN", hlp_sigrtmin },
45 { "byte-order", hlp_endianness },
46 { "wcsspn-ok", hlp_wcsspn_ok },
47 { "enotty-ok", hlp_enotty_ok },
48--
492.34.1
50
diff --git a/meta/recipes-core/util-linux/util-linux/0002-ts-kill-decode-use-SIGRTMIN-from-test_sysinfo-instea.patch b/meta/recipes-core/util-linux/util-linux/0002-ts-kill-decode-use-SIGRTMIN-from-test_sysinfo-instea.patch
new file mode 100644
index 0000000000..5a00c9037a
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/0002-ts-kill-decode-use-SIGRTMIN-from-test_sysinfo-instea.patch
@@ -0,0 +1,56 @@
1From 9848b0d8c90d9a24275bf402f6d76e97f62b3ba4 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jun 2025 16:27:19 +0800
4Subject: [PATCH 2/2] ts/kill/decode: use SIGRTMIN from test_sysinfo instead of
5 hardcoding 34
6
7glibc uses 34 as the value of SIGRTMIN:
8https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 """
9static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; """
10
11musl uses 35 as the value of SIGRTMIN:
12https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c
13
14With the hardcoded 34, test case fails with the following difference:
15
16-Ignored: HUP QUIT TRAP PIPE ALRM
17+Ignored: HUP QUIT TRAP PIPE ALRM 34
18
19Use SIGRTMIN got from test_sysinfo to fix this issue.
20
21Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3605]
22
23Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
24---
25 tests/ts/kill/decode | 9 +++++++--
26 1 file changed, 7 insertions(+), 2 deletions(-)
27
28diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode
29index 03bc25ff6..dd34aacef 100755
30--- a/tests/ts/kill/decode
31+++ b/tests/ts/kill/decode
32@@ -48,14 +48,19 @@ ACK=
33 # Sending one more USR1 is for making the signal pending state.
34 "$TS_CMD_KILL" -USR1 "$PID"
35 "$TS_CMD_KILL" -d "$PID" | {
36- if [[ $("$TS_CMD_KILL" --list=34) == RT0 ]]; then
37+ SIGRTMIN=$($TS_HELPER_SYSINFO SIGRTMIN)
38+ if [[ $("$TS_CMD_KILL" --list=$SIGRTMIN) == RT0 ]]; then
39 # See man signal(7).
40 # The Linux kernel supports a range of 33 different real-time signals,
41 # numbered 32 to 64. However, the glibc POSIX threads implementation in‐
42 # ternally uses two (for NPTL) or three (for LinuxThreads) real-time sig‐
43 # nals (see pthreads(7)), and adjusts the value of SIGRTMIN suitably (to
44 # 34 or 35).
45- sed -e s/' 32 33'// -e s/' 34'//
46+ sed_cmd="sed"
47+ for ((i=32; i<=SIGRTMIN; i++)); do
48+ sed_cmd+=" -e s/' $i'//"
49+ done
50+ eval $sed_cmd
51 else
52 cat
53 fi
54--
552.34.1
56