GNOME Bugzilla – Bug 726978
g_test_dbus_down() while a name is being watched => warning, test fails
Last modified: 2018-05-24 16:23:08 UTC
Since g_test_dbus_down() started prematurely disposing the GDBusConnection in 2.39.1 (Bug #711807), if a name-owner watch is cancelled while g_test_dbus_down() is waiting for the GDBusConnection to run out of references, the name-owner-watching code will trip a GObject warning, which defaults to being fatal while running regression tests. Here's an example of the backtrace:
+ Trace 233389
I think this is because g_object_real_dispose() clears all signal handlers, making it an error to disconnect them explicitly. I can't see how the name-owner-watching code could deal with this, apart from by using a GWeakRef to detect disposal (g_object_add_weak_pointer doesn't work because that only happens in finalize). Another solution would be for GTestDBus to stop forcibly disposing the connection.
(In reply to comment #0) > I can't see how the name-owner-watching code could deal with this, > apart from by using a GWeakRef to detect disposal (g_object_add_weak_pointer > doesn't work because that only happens in finalize). Sorry, my mistake, g_object_add_weak_pointer() or equivalent might be enough. It happens too late for some purposes because it's in g_object_real_dispose(), which is after my_derived_object_dispose(), but at least it isn't as late as finalize.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/850.