diff mbox series

glibc: Fix stale qemu processes left after glibc oe-selftest

Message ID 20240401081011.479084-1-Yash.Shinde@windriver.com
State New
Headers show
Series glibc: Fix stale qemu processes left after glibc oe-selftest | expand

Commit Message

Yash Shinde April 1, 2024, 8:10 a.m. UTC
From: Yash Shinde <Yash.Shinde@windriver.com>

qemumips and qemuppc were leaving stale processes behind after
running glibc oe-selftest. During analysis, it was found that
it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
Disable them so that there are no stale processes left behind.

[YOCTO #15423]
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
---
 .../glibc/glibc/0024-qemu-stale-process.patch | 45 +++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.39.bb         |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch

Comments

Randy MacLeod April 1, 2024, 9:06 a.m. UTC | #1
The short log is misleading since this isn't really a fix.

You have:

glibc: Fix stale qemu processes left after glibc oe-selftest


Maybe:

glibc: Skip 2 qemu tests that can hang in oe-selftest


Skipping is what we want for now but
have you tried  wrapping the hanging test in a script that runs:
strace -f -ttt -o foo <test>
?

Randy


On Mon, Apr 1, 2024, 04:10 Shinde, Yash via lists.openembedded.org
<Yash.Shinde=windriver.com@lists.openembedded.org> wrote:

> From: Yash Shinde <Yash.Shinde@windriver.com>
>
> qemumips and qemuppc were leaving stale processes behind after
> running glibc oe-selftest. During analysis, it was found that
> it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
> Disable them so that there are no stale processes left behind.
>
> [YOCTO #15423]
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
>
> Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> ---
>  .../glibc/glibc/0024-qemu-stale-process.patch | 45 +++++++++++++++++++
>  meta/recipes-core/glibc/glibc_2.39.bb         |  1 +
>  2 files changed, 46 insertions(+)
>  create mode 100644
> meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>
> diff --git a/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
> b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
> new file mode 100644
> index 0000000000..c28fa31b89
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
> @@ -0,0 +1,45 @@
> +glibc: Fix stale qemu processes left after glibc oe-selftest
> +
> +qemumips and qemuppc were leaving stale processes behind after
> +running glibc oe-selftest. During analysis, it was found that
> +it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
> +Disable them so that there are no stale processes left behind.
> +
> +[YOCTO #15423]
> +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
> +
> +Upstream-Status: Inappropriate [oe-core specific]
> +Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> +---
> +diff --git a/sysdeps/unix/sysv/linux/Makefile
> b/sysdeps/unix/sysv/linux/Makefile
> +--- a/sysdeps/unix/sysv/linux/Makefile    2024-03-18 01:15:49.019202881
> -0700
> ++++ b/sysdeps/unix/sysv/linux/Makefile  2024-03-14 06:26:18.581404107
> -0700
> +@@ -222,7 +222,6 @@
> +   tst-process_mrelease \
> +   tst-quota \
> +   tst-rlimit-infinity \
> +-  tst-scm_rights \
> +   tst-sigtimedwait \
> +   tst-sync_file_range \
> +   tst-sysconf-iov_max \
> +@@ -233,6 +232,8 @@
> +   tst-timerfd \
> +   tst-ttyname-direct \
> +   tst-ttyname-namespace \
> ++  # Skip this test to avoid stale qemu process
> ++  # tst-scm_rights \
> +   # tests
> +
> + # process_madvise requires CAP_SYS_ADMIN.
> +@@ -270,9 +271,10 @@
> +   tst-ntp_gettimex-time64 \
> +   tst-ppoll-time64 \
> +   tst-prctl-time64 \
> +-  tst-scm_rights-time64 \
> +   tst-sigtimedwait-time64 \
> +   tst-timerfd-time64 \
> ++  # Skip this test to avoid stale qemu process
> ++  # tst-scm_rights-time64 \
> +   # tests-time64
> +
> + tests-clone-internal = \
> diff --git a/meta/recipes-core/glibc/glibc_2.39.bb
> b/meta/recipes-core/glibc/glibc_2.39.bb
> index b203060064..9122472689 100644
> --- a/meta/recipes-core/glibc/glibc_2.39.bb
> +++ b/meta/recipes-core/glibc/glibc_2.39.bb
> @@ -49,6 +49,7 @@ SRC_URI =
> "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
>
> file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
>
> file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
>
> file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \
> +           file://0024-qemu-stale-process.patch \
>  "
>  S = "${WORKDIR}/git"
>  B = "${WORKDIR}/build-${TARGET_SYS}"
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#197678):
> https://lists.openembedded.org/g/openembedded-core/message/197678
> Mute This Topic: https://lists.openembedded.org/mt/105259855/953399
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> rwmacleod@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Yash Shinde April 1, 2024, 9:42 a.m. UTC | #2
On 01-04-2024 14:36, Randy MacLeod wrote:
> **
> *CAUTION: This email comes from a non Wind River email account!*
> Do not click links or open attachments unless you recognize the sender 
> and know the content is safe.
> The short log is misleading since this isn't really a fix.
>
> You have:
>
> glibc: Fix stale qemu processes left after glibc oe-selftest
>
>
> Maybe:
>
> glibc: Skip 2 qemu tests that can hang in oe-selftest
>
Will send a V2 with updated short log.
>
> Skipping is what we want for now but
> have you tried  wrapping the hanging test in a script that runs:
> strace -f -ttt -o foo <test>
> ?
>
I tried to reproduce and strace this issue outside yocto environment for 
ppc/mips target but make errors were observed when cross-compiling and 
building.
Thus, unable to capture strace logs.

With the latest poky sources, the issue is not reproducible locally and 
unable to check there also.

Regards,
Yash

> Randy
>
>
> On Mon, Apr 1, 2024, 04:10 Shinde, Yash via lists.openembedded.org 
> <https://urldefense.com/v3/__http://lists.openembedded.org__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSAEHYVEUA$> 
> <Yash.Shinde=windriver.com@lists.openembedded.org> wrote:
>
>     From: Yash Shinde <Yash.Shinde@windriver.com>
>
>     qemumips and qemuppc were leaving stale processes behind after
>     running glibc oe-selftest. During analysis, it was found that
>     it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
>     Disable them so that there are no stale processes left behind.
>
>     [YOCTO #15423]
>     https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
>     <https://urldefense.com/v3/__https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSBJ3U20Jw$>
>
>     Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
>     ---
>      .../glibc/glibc/0024-qemu-stale-process.patch | 45
>     +++++++++++++++++++
>      meta/recipes-core/glibc/glibc_2.39.bb
>     <https://urldefense.com/v3/__http://glibc_2.39.bb__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD3-s9FAQ$> 
>            |  1 +
>      2 files changed, 46 insertions(+)
>      create mode 100644
>     meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>
>     diff --git
>     a/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>     b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>     new file mode 100644
>     index 0000000000..c28fa31b89
>     --- /dev/null
>     +++ b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>     @@ -0,0 +1,45 @@
>     +glibc: Fix stale qemu processes left after glibc oe-selftest
>     +
>     +qemumips and qemuppc were leaving stale processes behind after
>     +running glibc oe-selftest. During analysis, it was found that
>     +it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
>     +Disable them so that there are no stale processes left behind.
>     +
>     +[YOCTO #15423]
>     +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
>     <https://urldefense.com/v3/__https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSBJ3U20Jw$>
>     +
>     +Upstream-Status: Inappropriate [oe-core specific]
>     +Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
>     +---
>     +diff --git a/sysdeps/unix/sysv/linux/Makefile
>     b/sysdeps/unix/sysv/linux/Makefile
>     +--- a/sysdeps/unix/sysv/linux/Makefile    2024-03-18
>     01:15:49.019202881 -0700
>     ++++ b/sysdeps/unix/sysv/linux/Makefile  2024-03-14
>     06:26:18.581404107 -0700
>     +@@ -222,7 +222,6 @@
>     +   tst-process_mrelease \
>     +   tst-quota \
>     +   tst-rlimit-infinity \
>     +-  tst-scm_rights \
>     +   tst-sigtimedwait \
>     +   tst-sync_file_range \
>     +   tst-sysconf-iov_max \
>     +@@ -233,6 +232,8 @@
>     +   tst-timerfd \
>     +   tst-ttyname-direct \
>     +   tst-ttyname-namespace \
>     ++  # Skip this test to avoid stale qemu process
>     ++  # tst-scm_rights \
>     +   # tests
>     +
>     + # process_madvise requires CAP_SYS_ADMIN.
>     +@@ -270,9 +271,10 @@
>     +   tst-ntp_gettimex-time64 \
>     +   tst-ppoll-time64 \
>     +   tst-prctl-time64 \
>     +-  tst-scm_rights-time64 \
>     +   tst-sigtimedwait-time64 \
>     +   tst-timerfd-time64 \
>     ++  # Skip this test to avoid stale qemu process
>     ++  # tst-scm_rights-time64 \
>     +   # tests-time64
>     +
>     + tests-clone-internal = \
>     diff --git a/meta/recipes-core/glibc/glibc_2.39.bb
>     <https://urldefense.com/v3/__http://glibc_2.39.bb__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD3-s9FAQ$>
>     b/meta/recipes-core/glibc/glibc_2.39.bb
>     <https://urldefense.com/v3/__http://glibc_2.39.bb__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD3-s9FAQ$>
>     index b203060064..9122472689 100644
>     --- a/meta/recipes-core/glibc/glibc_2.39.bb
>     <https://urldefense.com/v3/__http://glibc_2.39.bb__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD3-s9FAQ$>
>     +++ b/meta/recipes-core/glibc/glibc_2.39.bb
>     <https://urldefense.com/v3/__http://glibc_2.39.bb__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD3-s9FAQ$>
>     @@ -49,6 +49,7 @@ SRC_URI =
>     "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
>     file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch
>     \
>     file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch
>     \
>     file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch
>     \
>     + file://0024-qemu-stale-process.patch \
>      "
>      S = "${WORKDIR}/git"
>      B = "${WORKDIR}/build-${TARGET_SYS}"
>     -- 
>     2.43.0
>
>
>     -=-=-=-=-=-=-=-=-=-=-=-
>     Links: You receive all messages sent to this group.
>     View/Reply Online (#197678):
>     https://lists.openembedded.org/g/openembedded-core/message/197678
>     <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/message/197678__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSD_nlFatw$>
>     Mute This Topic:
>     https://lists.openembedded.org/mt/105259855/953399
>     <https://urldefense.com/v3/__https://lists.openembedded.org/mt/105259855/953399__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSDwV4R2SQ$>
>     Group Owner: openembedded-core+owner@lists.openembedded.org
>     <mailto:openembedded-core%2Bowner@lists.openembedded.org>
>     Unsubscribe:
>     https://lists.openembedded.org/g/openembedded-core/unsub
>     <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/unsub__;!!AjveYdw8EvQ!faU3OEL_GY3mffcv-d5kC1-J3efAL2vZ7s_BGVXjacmweHYyh4mRgvZVMhDDg7A6JW9ovUA3pSdMsSB6aZfgkA$>
>     [rwmacleod@gmail.com]
>     -=-=-=-=-=-=-=-=-=-=-=-
>
Yash Shinde April 1, 2024, 9:45 a.m. UTC | #3
On 01-04-2024 14:36, Randy MacLeod wrote:
>
> The short log is misleading since this isn't really a fix.
>
> You have:
>
> glibc: Fix stale qemu processes left after glibc oe-selftest
Will send a V2 with updated short log.
>
>
> Maybe:
>
> glibc: Skip 2 qemu tests that can hang in oe-selftest
>
>
> Skipping is what we want for now but
> have you tried  wrapping the hanging test in a script that runs:
> strace -f -ttt -o foo <test>
> ?
I tried to reproduce and strace this issue outside yocto environment for 
ppc/mips target but make errors were observed when cross-compiling and 
building.
Thus, unable to capture strace logs.

With the latest poky sources, the issue is not reproducible locally and 
unable to check there also.


Regards,
Yash
>
> Randy
Khem Raj April 1, 2024, 7:58 p.m. UTC | #4
it would be better to disable them just for architectures where it
fails since it seems to be a workaround, it would be good to keep it
as small as possible

On Mon, Apr 1, 2024 at 1:10 AM Shinde, Yash via lists.openembedded.org
<Yash.Shinde=windriver.com@lists.openembedded.org> wrote:
>
> From: Yash Shinde <Yash.Shinde@windriver.com>
>
> qemumips and qemuppc were leaving stale processes behind after
> running glibc oe-selftest. During analysis, it was found that
> it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
> Disable them so that there are no stale processes left behind.
>
> [YOCTO #15423]
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
>
> Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> ---
>  .../glibc/glibc/0024-qemu-stale-process.patch | 45 +++++++++++++++++++
>  meta/recipes-core/glibc/glibc_2.39.bb         |  1 +
>  2 files changed, 46 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
>
> diff --git a/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
> new file mode 100644
> index 0000000000..c28fa31b89
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
> @@ -0,0 +1,45 @@
> +glibc: Fix stale qemu processes left after glibc oe-selftest
> +
> +qemumips and qemuppc were leaving stale processes behind after
> +running glibc oe-selftest. During analysis, it was found that
> +it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
> +Disable them so that there are no stale processes left behind.
> +
> +[YOCTO #15423]
> +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
> +
> +Upstream-Status: Inappropriate [oe-core specific]
> +Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> +---
> +diff --git a/sysdeps/unix/sysv/linux/Makefile  b/sysdeps/unix/sysv/linux/Makefile
> +--- a/sysdeps/unix/sysv/linux/Makefile    2024-03-18 01:15:49.019202881 -0700
> ++++ b/sysdeps/unix/sysv/linux/Makefile  2024-03-14 06:26:18.581404107 -0700
> +@@ -222,7 +222,6 @@
> +   tst-process_mrelease \
> +   tst-quota \
> +   tst-rlimit-infinity \
> +-  tst-scm_rights \
> +   tst-sigtimedwait \
> +   tst-sync_file_range \
> +   tst-sysconf-iov_max \
> +@@ -233,6 +232,8 @@
> +   tst-timerfd \
> +   tst-ttyname-direct \
> +   tst-ttyname-namespace \
> ++  # Skip this test to avoid stale qemu process
> ++  # tst-scm_rights \
> +   # tests
> +
> + # process_madvise requires CAP_SYS_ADMIN.
> +@@ -270,9 +271,10 @@
> +   tst-ntp_gettimex-time64 \
> +   tst-ppoll-time64 \
> +   tst-prctl-time64 \
> +-  tst-scm_rights-time64 \
> +   tst-sigtimedwait-time64 \
> +   tst-timerfd-time64 \
> ++  # Skip this test to avoid stale qemu process
> ++  # tst-scm_rights-time64 \
> +   # tests-time64
> +
> + tests-clone-internal = \
> diff --git a/meta/recipes-core/glibc/glibc_2.39.bb b/meta/recipes-core/glibc/glibc_2.39.bb
> index b203060064..9122472689 100644
> --- a/meta/recipes-core/glibc/glibc_2.39.bb
> +++ b/meta/recipes-core/glibc/glibc_2.39.bb
> @@ -49,6 +49,7 @@ SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
>             file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
>             file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
>             file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \
> +           file://0024-qemu-stale-process.patch \
>  "
>  S = "${WORKDIR}/git"
>  B = "${WORKDIR}/build-${TARGET_SYS}"
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#197678): https://lists.openembedded.org/g/openembedded-core/message/197678
> Mute This Topic: https://lists.openembedded.org/mt/105259855/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Yash Shinde April 2, 2024, 7:15 a.m. UTC | #5
On 02-04-2024 01:28, Khem Raj wrote:
> it would be better to disable them just for architectures where it
> fails since it seems to be a workaround, it would be good to keep it
> as small as possible
>
Initially, we implemented the changes to handle only for architectures 
where it fails and reviewed it with Richard in a meeting,
but it was decided to skip the test cases rather than doing hard-coded 
changes.

Regards,
Yash
Richard Purdie April 2, 2024, 2:29 p.m. UTC | #6
On Tue, 2024-04-02 at 12:45 +0530, Shinde, Yash via
lists.openembedded.org wrote:
>  On 02-04-2024 01:28, Khem Raj wrote:
>  it would be better to disable them just for architectures where it
> > fails since it seems to be a workaround, it would be good to keep
> > it
> > as small as possible
> > 
>  Initially, we implemented the changes to handle only for
> architectures where it fails and reviewed it with Richard in a
> meeting,
>  but it was decided to skip the test cases rather than doing hard-
> coded changes.

You could make the application of the patch conditional upon being the
mips or powerpc architectures.

That does have advantages and disadvantages in that it is easy to miss
when upgrading the glibc recipe though.

Cheers,

Richard
Khem Raj April 2, 2024, 4:50 p.m. UTC | #7
On Tue, Apr 2, 2024 at 7:29 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Tue, 2024-04-02 at 12:45 +0530, Shinde, Yash via
> lists.openembedded.org wrote:
> >  On 02-04-2024 01:28, Khem Raj wrote:
> >  it would be better to disable them just for architectures where it
> > > fails since it seems to be a workaround, it would be good to keep
> > > it
> > > as small as possible
> > >
> >  Initially, we implemented the changes to handle only for
> > architectures where it fails and reviewed it with Richard in a
> > meeting,
> >  but it was decided to skip the test cases rather than doing hard-
> > coded changes.
>
> You could make the application of the patch conditional upon being the
> mips or powerpc architectures.

I think that will be more hassle than disabling it for all architectures.

>
> That does have advantages and disadvantages in that it is easy to miss
> when upgrading the glibc recipe though.
>
> Cheers,
>
> Richard
Yash Shinde April 5, 2024, 6:20 a.m. UTC | #8
On 02-04-2024 22:20, Khem Raj wrote:
>> You could make the application of the patch conditional upon being the
>> mips or powerpc architectures.
> I think that will be more hassle than disabling it for all architectures.
I see that V2 of this patch is already merged with master branch. 
(https://git.yoctoproject.org/poky/commit/?id=8d27d8ff7cc65d2059ca29352b57301ffc35a163)
But, I have made the changes to apply the patch only for mips or ppc 
architectures.

Please let me know if you want me to send the patch.
The changes are as follows:



diff --git a/meta/recipes-core/glibc/glibc_2.39.bb 
b/meta/recipes-core/glibc/glibc_2.39.bb
index 9122472689..497141f4bd 100644
--- a/meta/recipes-core/glibc/glibc_2.39.bb
+++ b/meta/recipes-core/glibc/glibc_2.39.bb
@@ -49,7 +49,6 @@ SRC_URI = 
"${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \
- file://0024-qemu-stale-process.patch \
  "
  S = "${WORKDIR}/git"
  B = "${WORKDIR}/build-${TARGET_SYS}"
@@ -89,6 +88,11 @@ PACKAGECONFIG ??= "nscd memory-tagging"
  PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
  PACKAGECONFIG[memory-tagging] = 
"--enable-memory-tagging,--disable-memory-tagging"

+python() {
+    if (d.getVar('MACHINE', True) == 'qemuppc' or d.getVar('MACHINE', 
True) == 'qemumips'):
+        d.appendVar('SRC_URI', ' file://0024-qemu-stale-process.patch')
+}
+
  do_patch:append() {
      bb.build.exec_func('do_fix_readlib_c', d)
  }


Regards,
Yash

>
>> That does have advantages and disadvantages in that it is easy to miss
>> when upgrading the glibc recipe though.
>>
>> Cheers,
>>
>> Richard
Richard Purdie April 5, 2024, 8:32 a.m. UTC | #9
On Fri, 2024-04-05 at 11:50 +0530, Yash Shinde wrote:
> On 02-04-2024 22:20, Khem Raj wrote:
> > > You could make the application of the patch conditional upon being the
> > > mips or powerpc architectures.
> > 
> > I think that will be more hassle than disabling it for all architectures.
> >  
> > 
> > 
> > 
>  I see that V2 of this patch is already merged with master branch. (https://git.yoctoproject.org/poky/commit/?id=8d27d8ff7cc65d2059ca29352b57301ffc35a163)
>  But, I have made the changes to apply the patch only for mips or ppc architectures.
>  
> 
> 
> 
>  Please let me know if you want me to send the patch.

Your patch was disabling per machine, not per architecture which is different.

As Khem said, we're worried that disabling just for specific machines
or architectures will make the recipe maintenance hard in the stable
branch. 

We're therefore happier with the original version which disables those
two tests unconditionally which is why I merged that instead.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
new file mode 100644
index 0000000000..c28fa31b89
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
@@ -0,0 +1,45 @@ 
+glibc: Fix stale qemu processes left after glibc oe-selftest
+
+qemumips and qemuppc were leaving stale processes behind after
+running glibc oe-selftest. During analysis, it was found that
+it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
+Disable them so that there are no stale processes left behind.
+
+[YOCTO #15423]
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
+---
+diff --git a/sysdeps/unix/sysv/linux/Makefile  b/sysdeps/unix/sysv/linux/Makefile
+--- a/sysdeps/unix/sysv/linux/Makefile    2024-03-18 01:15:49.019202881 -0700
++++ b/sysdeps/unix/sysv/linux/Makefile  2024-03-14 06:26:18.581404107 -0700
+@@ -222,7 +222,6 @@
+   tst-process_mrelease \
+   tst-quota \
+   tst-rlimit-infinity \
+-  tst-scm_rights \
+   tst-sigtimedwait \
+   tst-sync_file_range \
+   tst-sysconf-iov_max \
+@@ -233,6 +232,8 @@
+   tst-timerfd \
+   tst-ttyname-direct \
+   tst-ttyname-namespace \
++  # Skip this test to avoid stale qemu process
++  # tst-scm_rights \
+   # tests
+
+ # process_madvise requires CAP_SYS_ADMIN.
+@@ -270,9 +271,10 @@
+   tst-ntp_gettimex-time64 \
+   tst-ppoll-time64 \
+   tst-prctl-time64 \
+-  tst-scm_rights-time64 \
+   tst-sigtimedwait-time64 \
+   tst-timerfd-time64 \
++  # Skip this test to avoid stale qemu process
++  # tst-scm_rights-time64 \
+   # tests-time64
+
+ tests-clone-internal = \
diff --git a/meta/recipes-core/glibc/glibc_2.39.bb b/meta/recipes-core/glibc/glibc_2.39.bb
index b203060064..9122472689 100644
--- a/meta/recipes-core/glibc/glibc_2.39.bb
+++ b/meta/recipes-core/glibc/glibc_2.39.bb
@@ -49,6 +49,7 @@  SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
            file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
            file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \
+           file://0024-qemu-stale-process.patch \
 "
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build-${TARGET_SYS}"