Bug#894677: glib2.0: FTBFS on i386: test error occurred
Control: tags -1 + patch pending On Tue, 03 Apr 2018 at 11:24:38 +0100, Simon McVittie wrote: > [This] is an intermittent failure present since before stretch. I could > reproduce it on amd64 by running > > /usr/lib/glib2.0/installed-tests/glib/gapplication --tap > > several thousand times in a loop. The attached patch seems to address it. From: Simon McVittie Date: Wed, 4 Apr 2018 08:35:39 +0100 Subject: g_test_dbus_down: Ensure next test does not use old connection There's a race condition somewhere in GTestDBus that can result in the next test being started at a time when g_bus_get() would still return the connection that is in the process of closing. This can be reproduced reasonably reliably by running the gapplication test 10K times in a loop. Instead of relying on waiting for the weak reference to be released, we can force the issue by clearing it. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=768996 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894677 Forwarded: yes --- gio/gdbusconnection.c | 16 gio/gdbusprivate.h| 1 + gio/gtestdbus.c | 1 + 3 files changed, 18 insertions(+) diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index 6f7e5fe..2c74a73 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -7233,6 +7233,22 @@ _g_bus_get_singleton_if_exists (GBusType bus_type) return ret; } +/* May be called from any thread. Must not hold message_bus_lock. */ +void +_g_bus_forget_singleton (GBusType bus_type) +{ + GWeakRef *singleton; + + G_LOCK (message_bus_lock); + + singleton = message_bus_get_singleton (bus_type, NULL); + + if (singleton != NULL) +g_weak_ref_set (singleton, NULL); + + G_UNLOCK (message_bus_lock); +} + /** * g_bus_get_sync: * @bus_type: a #GBusType diff --git a/gio/gdbusprivate.h b/gio/gdbusprivate.h index 6a6a080..625177b 100644 --- a/gio/gdbusprivate.h +++ b/gio/gdbusprivate.h @@ -143,6 +143,7 @@ void _g_dbus_object_proxy_remove_interface (GDBusObjectProxy *proxy, /* Implemented in gdbusconnection.c */ GDBusConnection *_g_bus_get_singleton_if_exists (GBusType bus_type); +void _g_bus_forget_singleton(GBusType bus_type); G_END_DECLS diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c index 6eaf060..227f5b2 100644 --- a/gio/gtestdbus.c +++ b/gio/gtestdbus.c @@ -823,6 +823,7 @@ g_test_dbus_down (GTestDBus *self) _g_object_dispose_and_wait_weak_notify (connection); g_test_dbus_unset (); + _g_bus_forget_singleton (G_BUS_TYPE_SESSION); self->priv->up = FALSE; }
Processed: Re: Bug#894677: glib2.0: FTBFS on i386: test error occurred
Processing control commands: > tags -1 + patch pending Bug #894677 [src:glib2.0] FTBFS: Failed to register: The connection is closed; gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Added tag(s) pending and patch. -- 894677: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894677 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Processed: Re: Bug#894677: glib2.0: FTBFS on i386: test error occurred
Processing control commands: > retitle -1 FTBFS: Failed to register: The connection is closed; > gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Bug #894677 [src:glib2.0] glib2.0: gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Changed Bug title to 'FTBFS: Failed to register: The connection is closed; gio/tests/gapplication.c:572:test_quit: assertion failed: (activated)' from 'glib2.0: gio/tests/gapplication.c:572:test_quit: assertion failed: (activated)'. > forwarded -1 https://bugzilla.gnome.org/show_bug.cgi?id=768996 Bug #894677 [src:glib2.0] FTBFS: Failed to register: The connection is closed; gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Set Bug forwarded-to-address to 'https://bugzilla.gnome.org/show_bug.cgi?id=768996'. > found -1 2.49.3-1 Bug #894677 [src:glib2.0] FTBFS: Failed to register: The connection is closed; gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Marked as found in versions glib2.0/2.49.3-1. -- 894677: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894677 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#894677: glib2.0: FTBFS on i386: test error occurred
Control: retitle -1 FTBFS: Failed to register: The connection is closed; gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) Control: forwarded -1 https://bugzilla.gnome.org/show_bug.cgi?id=768996 Control: found -1 2.49.3-1 On Tue, 03 Apr 2018 at 11:00:23 +0100, Simon McVittie wrote: > On Tue, 03 Apr 2018 at 15:31:34 +0800, Boyuan Yang wrote: > > Justification: fails to build from source on release architecture (but > > built successfully in the past) > > This looks like a transient failure (a race condition in the test) > which was probably there for a long time. There have been no source code > changes since 2.56.0-1. Yes, this is an intermittent failure present since before stretch. I could reproduce it on amd64 by running /usr/lib/glib2.0/installed-tests/glib/gapplication --tap several thousand times in a loop. smcv
Processed: Re: Bug#894677: glib2.0: FTBFS on i386: test error occurred
Processing control commands: > retitle -1 glib2.0: gio/tests/gapplication.c:572:test_quit: assertion failed: > (activated) Bug #894677 [src:glib2.0] glib2.0: FTBFS on i386: test error occurred Changed Bug title to 'glib2.0: gio/tests/gapplication.c:572:test_quit: assertion failed: (activated)' from 'glib2.0: FTBFS on i386: test error occurred'. -- 894677: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894677 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#894677: glib2.0: FTBFS on i386: test error occurred
Control: retitle -1 glib2.0: gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) On Tue, 03 Apr 2018 at 15:31:34 +0800, Boyuan Yang wrote: > Justification: fails to build from source on release architecture (but > built successfully in the past) This looks like a transient failure (a race condition in the test) which was probably there for a long time. There have been no source code changes since 2.56.0-1. smcv
Bug#894677: glib2.0: FTBFS on i386: test error occurred
Source: glib2.0 Version: 2.56.0-5 Severity: serious Justification: fails to build from source on release architecture (but built successfully in the past) According to https://buildd.debian.org/status/package.php?p=glib2.0 , glib2.0 FTBFS on i386. >From >https://buildd.debian.org/status/fetch.php?pkg=glib2.0&arch=i386&ver=2.56.0-5&stamp=1522623405&raw=0 : [...] make[10]: Entering directory '/<>/debian/build/deb/gio/tests' PASS: gapplication 1 /gapplication/no-dbus PASS: gapplication 2 /gapplication/no-appid PASS: gapplication 3 /gapplication/properties PASS: gapplication 4 /gapplication/app-id ERROR: gapplication - Bail out! GLib-GIO:ERROR:../../../../../gio/tests/gapplication.c:572:test_quit: assertion failed: (activated) make[10]: Leaving directory '/<>/debian/build/deb/gio/tests' [...] -- Regards, Boyuan Yang