Timer test flaky on x87
To reproduce:
CC="gcc -m32" CXX="g++ -m32" PKG_CONFIG=pkg-config-32 meson b
ninja -C b
Repeatedly run b/glib/tests/timer
. Sometimes produces one of these errors:
GLib:ERROR:../glib/tests/timer.c:38:test_timer_basic: assertion failed (micros == ((guint64)(elapsed * 1e6)) % 1000000): (1 == 0)
GLib:ERROR:../glib/tests/timer.c:38:test_timer_basic: assertion failed (micros == ((guint64)(elapsed * 1e6)) % 1000000): (2 == 1)
GLib:ERROR:../glib/tests/timer.c:57:test_timer_stop: assertion failed (elapsed == elapsed2): (1e-06 == 1e-06)
It seems that the excess precision of the FPU is a cause, as the test_timer_stop
error compares an 80-bit value and a truncated 64-bit value.
GLib 2.60.3
GCC 8.3.0
Arch Linux