Message ID | 20250603071720.2055740-1-Qi.Chen@windriver.com |
---|---|
State | New |
Headers | show |
Series | util-linux: fix ptest failure for musl | expand |
On 6/3/25 12:17 AM, Chen Qi via lists.openembedded.org wrote: > From: Chen Qi <Qi.Chen@windriver.com> > > 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 a patch to fix this issue. > > Signed-off-by: Chen Qi <Qi.Chen@windriver.com> > --- > meta/recipes-core/util-linux/util-linux.inc | 1 + > .../0001-ts-kill-decode-fix-for-musl.patch | 43 +++++++++++++++++++ > 2 files changed, 44 insertions(+) > create mode 100644 meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch > > diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc > index b0f2a9d497..2d003c28b2 100644 > --- a/meta/recipes-core/util-linux/util-linux.inc > +++ b/meta/recipes-core/util-linux/util-linux.inc > @@ -42,6 +42,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin > file://fcntl-lock.c \ > 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-fix-for-musl.patch \ > " > > SRC_URI[sha256sum] = "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6" > diff --git a/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch > new file mode 100644 > index 0000000000..efdd019cda > --- /dev/null > +++ b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch > @@ -0,0 +1,43 @@ > +From e6b6e401b0046a524e2e3e3db66f1b85b06fa2d4 Mon Sep 17 00:00:00 2001 > +From: Chen Qi <Qi.Chen@windriver.com> > +Date: Tue, 3 Jun 2025 13:18:36 +0800 > +Subject: [PATCH] ts/kill/decode: fix for musl > + > +glibc uses 34 as the value of SIGRTMIN: > +https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 > +""" > +static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; > +""" > + > +musl uses 35 as the value of SIGRTMIN: > +https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c > + > +Adjust the test case to cope with musl. Otherwise, it fails with > +the following difference: > + > + -Ignored: HUP QUIT TRAP PIPE ALRM > + +Ignored: HUP QUIT TRAP PIPE ALRM 34 > + > +Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3605] > + > +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> > +--- > + tests/ts/kill/decode | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode > +index 57149899e..f17ea36e2 100755 > +--- a/tests/ts/kill/decode > ++++ b/tests/ts/kill/decode > +@@ -53,7 +53,7 @@ ACK= > + # Sending one more USR1 is for making the signal pending state. > + "$TS_CMD_KILL" -USR1 "$PID" > + "$TS_CMD_KILL" -d "$PID" | { > +- if [[ $("$TS_CMD_KILL" --list=34) == RT0 ]]; then > ++ if [[ $("$TS_CMD_KILL" --list=34) == RT0 || $("$TS_CMD_KILL" --list=35) == RT0 ]]; then hardcoding these values are perhaps not ideal. Maybe using SIGRTMIN here could make it work across platforms. > + # See man signal(7). > + # The Linux kernel supports a range of 33 different real-time signals, > + # numbered 32 to 64. However, the glibc POSIX threads implementation in‐ > +-- > +2.34.1 > + > > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#217761): https://lists.openembedded.org/g/openembedded-core/message/217761 > Mute This Topic: https://lists.openembedded.org/mt/113443532/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
I'll update PR and send out V2. Regards, Qi On 6/4/25 04:20, Khem Raj wrote: > > > On 6/3/25 12:17 AM, Chen Qi via lists.openembedded.org wrote: >> From: Chen Qi <Qi.Chen@windriver.com> >> >> 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 a patch to fix this issue. >> >> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> >> --- >> meta/recipes-core/util-linux/util-linux.inc | 1 + >> .../0001-ts-kill-decode-fix-for-musl.patch | 43 +++++++++++++++++++ >> 2 files changed, 44 insertions(+) >> create mode 100644 >> meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch >> >> diff --git a/meta/recipes-core/util-linux/util-linux.inc >> b/meta/recipes-core/util-linux/util-linux.inc >> index b0f2a9d497..2d003c28b2 100644 >> --- a/meta/recipes-core/util-linux/util-linux.inc >> +++ b/meta/recipes-core/util-linux/util-linux.inc >> @@ -42,6 +42,7 @@ SRC_URI = >> "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin >> file://fcntl-lock.c \ >> 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-fix-for-musl.patch \ >> " >> SRC_URI[sha256sum] = >> "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6" >> diff --git >> a/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch >> b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch >> >> new file mode 100644 >> index 0000000000..efdd019cda >> --- /dev/null >> +++ >> b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch >> @@ -0,0 +1,43 @@ >> +From e6b6e401b0046a524e2e3e3db66f1b85b06fa2d4 Mon Sep 17 00:00:00 2001 >> +From: Chen Qi <Qi.Chen@windriver.com> >> +Date: Tue, 3 Jun 2025 13:18:36 +0800 >> +Subject: [PATCH] ts/kill/decode: fix for musl >> + >> +glibc uses 34 as the value of SIGRTMIN: >> +https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 >> >> +""" >> +static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; >> +""" >> + >> +musl uses 35 as the value of SIGRTMIN: >> +https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c >> + >> +Adjust the test case to cope with musl. Otherwise, it fails with >> +the following difference: >> + >> + -Ignored: HUP QUIT TRAP PIPE ALRM >> + +Ignored: HUP QUIT TRAP PIPE ALRM 34 >> + >> +Upstream-Status: Submitted >> [https://github.com/util-linux/util-linux/pull/3605] >> + >> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> >> +--- >> + tests/ts/kill/decode | 2 +- >> + 1 file changed, 1 insertion(+), 1 deletion(-) >> + >> +diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode >> +index 57149899e..f17ea36e2 100755 >> +--- a/tests/ts/kill/decode >> ++++ b/tests/ts/kill/decode >> +@@ -53,7 +53,7 @@ ACK= >> + # Sending one more USR1 is for making the signal pending >> state. >> + "$TS_CMD_KILL" -USR1 "$PID" >> + "$TS_CMD_KILL" -d "$PID" | { >> +- if [[ $("$TS_CMD_KILL" --list=34) == RT0 ]]; then >> ++ if [[ $("$TS_CMD_KILL" --list=34) == RT0 || >> $("$TS_CMD_KILL" --list=35) == RT0 ]]; then > > hardcoding these values are perhaps not ideal. Maybe using SIGRTMIN > here could make it work across platforms. > >> + # See man signal(7). >> + # The Linux kernel supports a range of 33 >> different real-time signals, >> + # numbered 32 to 64. However, the glibc POSIX >> threads implementation in‐ >> +-- >> +2.34.1 >> + >> >> >> >> -=-=-=-=-=-=-=-=-=-=-=- >> Links: You receive all messages sent to this group. >> View/Reply Online (#217761): >> https://lists.openembedded.org/g/openembedded-core/message/217761 >> Mute This Topic: https://lists.openembedded.org/mt/113443532/1997914 >> Group Owner: openembedded-core+owner@lists.openembedded.org >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub >> [raj.khem@gmail.com] >> -=-=-=-=-=-=-=-=-=-=-=- >> >
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index b0f2a9d497..2d003c28b2 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -42,6 +42,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://fcntl-lock.c \ 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-fix-for-musl.patch \ " SRC_URI[sha256sum] = "81ee93b3cfdfeb7d7c4090cedeba1d7bbce9141fd0b501b686b3fe475ddca4c6" diff --git a/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch new file mode 100644 index 0000000000..efdd019cda --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0001-ts-kill-decode-fix-for-musl.patch @@ -0,0 +1,43 @@ +From e6b6e401b0046a524e2e3e3db66f1b85b06fa2d4 Mon Sep 17 00:00:00 2001 +From: Chen Qi <Qi.Chen@windriver.com> +Date: Tue, 3 Jun 2025 13:18:36 +0800 +Subject: [PATCH] ts/kill/decode: fix for musl + +glibc uses 34 as the value of SIGRTMIN: +https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 +""" +static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; +""" + +musl uses 35 as the value of SIGRTMIN: +https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c + +Adjust the test case to cope with musl. Otherwise, it fails with +the following difference: + + -Ignored: HUP QUIT TRAP PIPE ALRM + +Ignored: HUP QUIT TRAP PIPE ALRM 34 + +Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/3605] + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + tests/ts/kill/decode | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode +index 57149899e..f17ea36e2 100755 +--- a/tests/ts/kill/decode ++++ b/tests/ts/kill/decode +@@ -53,7 +53,7 @@ ACK= + # Sending one more USR1 is for making the signal pending state. + "$TS_CMD_KILL" -USR1 "$PID" + "$TS_CMD_KILL" -d "$PID" | { +- if [[ $("$TS_CMD_KILL" --list=34) == RT0 ]]; then ++ if [[ $("$TS_CMD_KILL" --list=34) == RT0 || $("$TS_CMD_KILL" --list=35) == RT0 ]]; then + # See man signal(7). + # The Linux kernel supports a range of 33 different real-time signals, + # numbered 32 to 64. However, the glibc POSIX threads implementation in‐ +-- +2.34.1 +