From 4752d72a601787ef5a2249674a3ff887f42320e6 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 31 Jan 2018 22:21:55 +0000 Subject: [PATCH] gdbusaddress: Disable proxy support for D-Bus addresses See the discussion in the bug report: with proxy support enabled, a proxy resolver is created. Doing that will load all the GIO modules, and typically at least one of them will try to use GDBus during initialisation, which will cause a deadlock. Using a TCP address with GDBusAddress is still supported, but accessing it over a proxy is not. Document this. Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=792499 --- gio/gdbusaddress.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c index faee80087..2191c115a 100644 --- a/gio/gdbusaddress.c +++ b/gio/gdbusaddress.c @@ -66,6 +66,9 @@ * like `unix:tmpdir=/tmp/my-app-name`. The exact format of addresses * is explained in detail in the * [D-Bus specification](http://dbus.freedesktop.org/doc/dbus-specification.html#addresses). + * + * TCP D-Bus connections are supported, but accessing them via a proxy is + * currently not supported. */ static gchar *get_session_address_platform_specific (GError **error); @@ -675,6 +678,13 @@ g_dbus_address_connect (const gchar *address_entry, g_assert (ret == NULL); client = g_socket_client_new (); + + /* Disable proxy support to prevent a deadlock on startup, since loading a + * proxy resolver causes the GIO modules to be loaded, and there will + * almost certainly be one of them which then tries to use GDBus. + * See: https://bugzilla.gnome.org/show_bug.cgi?id=792499 */ + g_socket_client_set_enable_proxy (client, FALSE); + connection = g_socket_client_connect (client, connectable, cancellable,