glib-2.0: skip a timing sensitive monotonic-time ptest
PATCH 1/1 glib-2.0: skip a timing sensitive monotonic-time ptest
The /monotonic-time-ns/similar test compares g_get_monotonic_time() and g_get_monotonic_time_ns() by spinning until the microsecond clock ticks and asserting the two clocks haven't diverged. This is inherently racy under QEMU emulation on loaded hosts, as the process can be preempted between the clock reads.
[YOCTO #16230] : https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230
--- .../files/skip-monotonic-time-similar.patch | 32 +++++++++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch
meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Pratik Farkase <[email protected]> +Date: Tue, 5 Aug 2026 08:00:00 +0000 +Subject: [PATCH] Skip /monotonic-time-ns/similar test + +The test_similar test compares g_get_monotonic_time() and +g_get_monotonic_time_ns() by spinning until the microsecond clock ticks +and then asserting the two clocks haven't diverged beyond a factor of +50. This is inherently racy under QEMU emulation on loaded hosts: the +process can be preempted between the two clock reads, causing the +assertion "50 * ns_elapsed > 1000 * us_elapsed" to fail. + +https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230 + +Upstream-Status: Inappropriate [OE-specific] +Signed-off-by: Pratik Farkase <[email protected]> +--- + glib/tests/monotonic-time.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/glib/tests/monotonic-time.c b/glib/tests/monotonic-time.c +index 1234567..abcdef0 100644 +--- a/glib/tests/monotonic-time.c ++++ b/glib/tests/monotonic-time.c +@@ -153,7 +153,6 @@ main (int argc, char *argv[]) + g_test_add_func ("/monotonic-time-ns/increasing", test_increasing_ns); + g_test_add_func ("/monotonic-time/usleep", test_usleep); + g_test_add_func ("/monotonic-time-ns/usleep", test_usleep_ns); +- g_test_add_func ("/monotonic-time-ns/similar", test_similar); + + return g_test_run (); + }
meta/recipes-core/glib-2.0/glib.inc +1 -0
@@ -235,6 +235,7 @@ SRC_URI += "\ file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ file://0010-Do-not-hardcode-python-path-into-various-tools.patch \ file://skip-timeout.patch \ + file://skip-monotonic-time-similar.patch \ file://CVE-2026-58016-1.patch \ file://CVE-2026-58016-2.patch \ file://0001-gio-tests-services-Fix-installed-service-file-using-.patch \
Signature · 1 line
2.34.1
meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch line 15
Quoted 12 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch new file +12
-0+Subject: [PATCH] Skip /monotonic-time-ns/similar test + +The test_similar test compares g_get_monotonic_time() and +g_get_monotonic_time_ns() by spinning until the microsecond clock ticks +and then asserting the two clocks haven't diverged beyond a factor of +50. This is inherently racy under QEMU emulation on loaded hosts: the +process can be preempted between the two clock reads, causing the +assertion "50 * ns_elapsed > 1000 * us_elapsed" to fail. + +https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230 + +Upstream-Status: Inappropriate [OE-specific]
Hello Pratik,
the patch is Inappropriate, but it is not oe-specific; the issue can happen on any loaded host. The actual reason for Inappropriate status
is: it does not address the issue in the test, but simply disables it altogether, which is not an appropriate fix to suggest to upstream.
Can you please open a ticket upstream, and include the link in the patch, like below?
Upstream-Status: Inappropriate [upstream ticket: <link>]
Alex
PATCH v2 1/1 glib-2.0: skip a timing sensitive monotonic-time ptest
In reply to Pratik FarkaseThe /monotonic-time-ns/similar test compares g_get_monotonic_time() and g_get_monotonic_time_ns() by spinning until the microsecond clock ticks and asserting the two clocks haven't diverged. This is inherently racy under QEMU emulation on loaded hosts, as the process can be preempted between the clock reads.
[YOCTO #16230]
--- .../files/skip-monotonic-time-similar.patch | 32 +++++++++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch
meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Pratik Farkase <[email protected]> +Date: Tue, 5 Aug 2026 08:00:00 +0000 +Subject: [PATCH] Skip /monotonic-time-ns/similar test + +The test_similar test compares g_get_monotonic_time() and +g_get_monotonic_time_ns() by spinning until the microsecond clock ticks +and then asserting the two clocks haven't diverged beyond a factor of +50. This is inherently racy under QEMU emulation on loaded hosts: the +process can be preempted between the two clock reads, causing the +assertion "50 * ns_elapsed > 1000 * us_elapsed" to fail. + +https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230 + +Upstream-Status: Inappropriate [upstream ticket: https://gitlab.gnome.org/GNOME/glib/-/work_items/4025] +Signed-off-by: Pratik Farkase <[email protected]> +--- + glib/tests/monotonic-time.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/glib/tests/monotonic-time.c b/glib/tests/monotonic-time.c +index 04ff898..dae0533 100644 +--- a/glib/tests/monotonic-time.c ++++ b/glib/tests/monotonic-time.c +@@ -153,7 +153,6 @@ main (int argc, char *argv[]) + g_test_add_func ("/monotonic-time-ns/increasing", test_increasing_ns); + g_test_add_func ("/monotonic-time/usleep", test_usleep); + g_test_add_func ("/monotonic-time-ns/usleep", test_usleep_ns); +- g_test_add_func ("/monotonic-time-ns/similar", test_similar); + + return g_test_run (); + }
meta/recipes-core/glib-2.0/glib.inc +1 -0
@@ -235,6 +235,7 @@ SRC_URI += "\ file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ file://0010-Do-not-hardcode-python-path-into-various-tools.patch \ file://skip-timeout.patch \ + file://skip-monotonic-time-similar.patch \ file://CVE-2026-58016-1.patch \ file://CVE-2026-58016-2.patch \ file://0001-gio-tests-services-Fix-installed-service-file-using-.patch \
Signature · 1 line
2.43.0
Quoted 10 lines · Pratik Farkase
The /monotonic-time-ns/similar test compares
g_get_monotonic_time()andg_get_monotonic_time_ns()by spinning until the microsecond clock ticks and asserting the two clocks haven't diverged. This is inherently racy under QEMU emulation on loaded hosts, as the process can be preempted between the clock reads.[YOCTO #16230]
Signed-off-by Pratik Farkase <[email protected]>---
Hi Pratik,
Thanks for the v2, but it looks like the v1 was merged, despite the pending comment from Alex.
Do you mind rebasing on master and sending a fix commit for the Upstream-Status?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Mathieu,
Sent it here : https://lists.openembedded.org/g/openembedded-core/message/243337
Best Regards,
Pratik
________________________________________
From: Mathieu Dubois-Briand <[email protected]>
Sent: Wednesday, August 12, 2026 3:17 PM
To: Pratik Farkase; [email protected]
Cc: [email protected]
Subject: Re: [OE-core][PATCH v2] glib-2.0: skip a timing sensitive monotonic-time ptest
Quoted 10 lines · Pratik Farkase
The /monotonic-time-ns/similar test compares
g_get_monotonic_time()andg_get_monotonic_time_ns()by spinning until the microsecond clock ticks and asserting the two clocks haven't diverged. This is inherently racy under QEMU emulation on loaded hosts, as the process can be preempted between the clock reads.[YOCTO #16230]
Signed-off-by Pratik Farkase <[email protected]>---
Hi Pratik,
Thanks for the v2, but it looks like the v1 was merged, despite the pending comment from Alex.
Do you mind rebasing on master and sending a fix commit for the Upstream-Status?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 1/1 glib-2.0: fix Upstream-Status in skip-monotonic-time-similar.patch
In reply to Pratik FarkaseUpdate Upstream-Status from 'Inappropriate [OE-specific]' to 'Inappropriate [upstream ticket: ...]' with a link to the upstream issue filed at GNOME GitLab.
[YOCTO #16230]
--- .../glib-2.0/files/skip-monotonic-time-similar.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch +1 -1
@@ -12,7 +12,7 @@ assertion "50 * ns_elapsed > 1000 * us_elapsed" to fail. https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230 -Upstream-Status: Inappropriate [OE-specific] +Upstream-Status: Inappropriate [upstream ticket: https://gitlab.gnome.org/GNOME/glib/-/work_items/4025] Signed-off-by: Pratik Farkase <[email protected]> --- glib/tests/monotonic-time.c | 1 -
Signature · 1 line
2.43.0