After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726978 - g_test_dbus_down() while a name is being watched => warning, test fails
g_test_dbus_down() while a name is being watched => warning, test fails
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-03-24 16:37 UTC by Simon McVittie
Modified: 2018-05-24 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon McVittie 2014-03-24 16:37:49 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:

  • #0 g_logv
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./glib/gmessages.c line 1038
  • #1 g_log
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./glib/gmessages.c line 1071
  • #2 g_signal_handler_disconnect
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gsignal.c line 2580
  • #3 client_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gio/gdbusnamewatching.c line 100
  • #4 book_client_finalize
    at e-book-client.c line 545
  • #5 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3112
  • #6 book_client_view_dispose
    at e-book-client-view.c line 794
  • #7 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3075
  • #8 edsf_persona_store_finalize
    at /home/smcv/src/gnome/folks-tp/backends/eds/lib/edsf-persona-store.vala line 52
  • #9 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3112
  • #10 ??
    from /usr/lib/x86_64-linux-gnu/libgee-0.8.so.2
  • #11 ??
    from /usr/lib/x86_64-linux-gnu/libgee-0.8.so.2
  • #12 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3112
  • #13 folks_individual_aggregator_finalize
    at /home/smcv/src/gnome/folks-tp/folks/individual-aggregator.vala line 128
  • #14 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3112
  • #15 individual_retrieval_tests_finalize
    at /home/smcv/src/gnome/folks-tp/tests/eds/individual-retrieval.vala line 28
  • #16 g_object_unref
    at /build/glib2.0-V5GbKs/glib2.0-2.39.92/./gobject/gobject.c line 3112
  • #17 _vala_main
    at /home/smcv/src/gnome/folks-tp/tests/eds/individual-retrieval.vala line 128
  • #18 __libc_start_main
    at libc-start.c line 287
  • #19 _start

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.
Comment 1 Simon McVittie 2014-03-24 16:40:39 UTC
(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.
Comment 2 GNOME Infrastructure Team 2018-05-24 16:23:08 UTC
-- 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.