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 715157 - GDBusObjectManager doesn't check if GDBusConnection is actually open
GDBusObjectManager doesn't check if GDBusConnection is actually open
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: 2013-11-25 13:44 UTC by Aleksander Morgado
Modified: 2018-05-24 16:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aleksander Morgado 2013-11-25 13:44:46 UTC
So, I'm doing some unit tests with ModemManager, using the GTestDBus support. ModemManager uses the GDBusObjectManager implementation from GDBus. The thing is, that when g_test_dbus_down() is called, the GDBusConnection will get closed in the ModemManager service, but due to MM's behaviour the object implementing the ObjectManager interface will try to cleanup all the objects it handles (e.g. to cleanly close the modem control protocol), and part of the logic will involve removing interfaces from DBus. When that happens, I will end up getting the following assertion:

GLib-GIO:ERROR:gdbusobjectmanagerserver.c:966:g_dbus_object_manager_server_emit_interfaces_removed: assertion failed (error == NULL): The connection is closed (g-io-error-quark, 18)

The GDBusObjectManager keeps a GDBusConnection reference around, but when wanting to emit e.g. interface-removed (g_dbus_object_manager_server_emit_interfaces_removed), it assumes that if the GDBusConnection exists it will be open:

  if (data->manager->priv->connection == NULL)
    goto out;
  else... emit signal

Shouldn't the logic check not only for a valid GDBusConnection, but also for it being *open* (e.g. with g_dbus_connection_is_closed())?

Of course this case is very specific, as it really is about the bus disappearing during a test and MM trying to cleanup stuff even after having lost the well-known name, but anyway...

I guess that to avoid this issue I can always set connection to NULL as soon as get the name lost signal, but still, I believe this could be a valid bug, unless I'm missing something.
Comment 1 GNOME Infrastructure Team 2018-05-24 16:04:37 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/795.