From: "Paul Barker" <paul@pbarker.dev>
To: "Pratik Farkase" <pratik.farkase@est.tech>,
<openembedded-core@lists.openembedded.org>
Cc: <pratik.farkase@ericsson.com>
Subject: Re: [OE-core][PATCH] glib-2.0: ptest: skip memory-monitor-psi /dev/null test
Date: Thu, 05 Nov 2026 14:51:08 +0000 [thread overview]
Message-ID: <DMND10P3QR3O.3C38IOM96LHDE@pbarker.dev> (raw)
In-Reply-To: <20261026121406.30391-1-pratik.farkase@est.tech>
On Mon Oct 26, 2026 at 12:14 PM GMT, Pratik Farkase wrote:
> The /memory-monitor-psi-env-set/write-env-null test sets
> MEMORY_PRESSURE_WATCH=/dev/null and asserts that no low-memory-warning
> is emitted. That assumption is unsound: GMemoryMonitorPsi polls the
> watch fd for G_IO_IN and /dev/null is always readable, so the
> low-memory callback fires and the assertion (warning_level == -1)
> fails. It reproduces under QEMU system emulation on the autobuilders
> (qemuarm64), and the resulting abort leaves the mock PSI FIFO behind,
> cascading into a mkfifo failure in the memory-monitor-psi test.
>
> Add a patch dropping the test (and its now-unused function); the other
> memory-monitor-psi-env-set subtests still run.
>
> [YOCTO #16464]
>
> Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
> ---
> ...ip-memory-monitor-psi-write-env-null.patch | 88 +++++++++++++++++++
> meta/recipes-core/glib-2.0/glib.inc | 1 +
> 2 files changed, 89 insertions(+)
> create mode 100644 meta/recipes-core/glib-2.0/files/skip-memory-monitor-psi-write-env-null.patch
>
> diff --git a/meta/recipes-core/glib-2.0/files/skip-memory-monitor-psi-write-env-null.patch b/meta/recipes-core/glib-2.0/files/skip-memory-monitor-psi-write-env-null.patch
> new file mode 100644
> index 0000000000..aa9ef919df
> --- /dev/null
> +++ b/meta/recipes-core/glib-2.0/files/skip-memory-monitor-psi-write-env-null.patch
> @@ -0,0 +1,88 @@
> +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> +From: Pratik Farkase <pratik.farkase@est.tech>
> +Date: Mon, 26 Oct 2026 11:55:00 +0000
> +Subject: [PATCH] Skip /memory-monitor-psi-env-set/write-env-null test
> +
> +test_write_env_null sets MEMORY_PRESSURE_WATCH=/dev/null and asserts
> +that no low-memory-warning signal is emitted (warning_level stays -1).
> +
> +This assumption does not hold. When MEMORY_PRESSURE_WATCH points at an
> +existing path, GMemoryMonitorPsi opens it with O_RDWR | O_NONBLOCK and
> +creates a GSource polling for G_IO_IN. /dev/null is always readable
> +(reads return immediate EOF), so the source is immediately dispatchable,
> +the low-memory callback fires and warning_level becomes 50, making the
> +assertion (warning_level == -1) fail:
> +
> + GLib-GIO:ERROR:.../gio/tests/memory-monitor-psi-env-set.c:300:
> + test_write_env_null: assertion failed (warning_level == -1): (50 == -1)
> +
> +Whether the spurious event is caught before the monitor is torn down
> +depends on GMainContext iteration timing, so it only reproduces in
> +slower environments such as QEMU system emulation on the Yocto
> +autobuilders (seen on qemuarm64). The test's abort also leaves the mock
> +PSI FIFO $TMPDIR/cgroup behind, which then makes the separate
> +memory-monitor-psi test fail in tests_setup with "mkfifo(): File exists".
> +
> +Drop the test registration and the now-unused test function. The
> +remaining memory-monitor-psi-env-set subtests still run.
> +
> +https://bugzilla.yoctoproject.org/show_bug.cgi?id=16464
> +
> +Upstream-Status: Inappropriate [upstream ticket: https://gitlab.gnome.org/GNOME/glib/-/work_items/4094]
> +Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
> +---
> + gio/tests/memory-monitor-psi-env-set.c | 36 --------------------------
> + 1 file changed, 36 deletions(-)
> +
> +--- a/gio/tests/memory-monitor-psi-env-set.c
> ++++ b/gio/tests/memory-monitor-psi-env-set.c
> +@@ -269,39 +269,6 @@
> + g_clear_error (&local_error);
> + }
> +
> +-static void
> +-test_write_env_null (SetupData *setup, gconstpointer data)
> +-{
> +- GMemoryMonitorPsi *monitor;
> +- unsigned long warning_id;
> +- int warning_level = -1;
> +- GError *local_error = NULL;
> +-
> +- /* The contents is generated by running "dd if=/dev/random of=/foo/bar bs=128 count=1" */
> +- const gchar *env_write = "hVh9eV0BZsh/GWEs9V6zKyO3VUe2MnxTxLZbA7BRo7GJKHAAayIRsgO8EI4m8iFskhx/O4cAfpyL"
> +- "YQ8LFHMG5XBuBmqD9spZghu0eVYF2X8lCCT+iBlEFw5dWiSa6XwJN++AmHi1tp4uJj0UBR7CwV5c"
> +- "+ms9ZDUqOQrvlFHUSxw=";
> +-
> +- g_setenv ("MEMORY_PRESSURE_WATCH", "/dev/null", TRUE);
> +- g_setenv ("MEMORY_PRESSURE_WRITE", env_write, TRUE);
> +-
> +- monitor = g_object_new (G_TYPE_MEMORY_MONITOR_PSI,
> +- "proc-path", setup->mock_proc_path,
> +- NULL);
> +- warning_id = g_signal_connect (monitor, "low-memory-warning",
> +- G_CALLBACK (memory_monitor_psi_signal_cb), &warning_level);
> +- g_initable_init (G_INITABLE (monitor), NULL, &local_error);
> +- g_assert_no_error (local_error);
> +-
> +- g_signal_handler_disconnect (monitor, warning_id);
> +- g_object_unref (monitor);
> +-
> +- /* warning_level shouldn't be set */
> +- g_assert_cmpint (warning_level, ==, -1);
> +-
> +- g_clear_error (&local_error);
> +-}
> +-
Hi Pratik,
The other patches for glib-2.0 do not remove the actual test function,
just the g_test_add() call below. That is preferred as the diff is
smaller and so there will be less need to rebase as we update to future
releases. Could you send a v2 which just does that?
> + static gpointer
> + test_write_env_unix_domain_socket_thread (gpointer user_data)
> + {
> +@@ -395,9 +362,6 @@
> + g_test_add ("/memory-monitor-psi-env-set/write-env", SetupData, NULL,
> + tests_setup, test_write_env, tests_teardown);
> +
> +- g_test_add ("/memory-monitor-psi-env-set/write-env-null", SetupData, NULL,
> +- tests_setup, test_write_env_null, tests_teardown);
> +-
> + g_test_add ("/memory-monitor-psi-env-set/write-env-unix-domain-socket", SetupData, NULL,
> + tests_unix_domain_setup, test_write_env_unix_domain_socket, tests_unix_domain_teardown);
> +
Best regards,
--
Paul Barker
prev parent reply other threads:[~2026-11-05 14:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 12:14 [OE-core][PATCH] glib-2.0: ptest: skip memory-monitor-psi /dev/null test Pratik Farkase
2026-11-05 14:51 ` Paul Barker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMND10P3QR3O.3C38IOM96LHDE@pbarker.dev \
--to=paul@pbarker.dev \
--cc=openembedded-core@lists.openembedded.org \
--cc=pratik.farkase@ericsson.com \
--cc=pratik.farkase@est.tech \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox