Opened 11 years ago

Closed 11 years ago

#39145 closed enhancement (fixed)

glib2, glib2-devel: add MacPorts specific dbus session support to GDbus.

Reported by: dbevans (David B. Evans) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: dbus Cc: cooljeanius (Eric Gallager)
Port: glib2

Description

An increasing number of GNOME and other GTK+ applications emit the following error or similar on start up:

Error spawning command line `dbus-launch --autolaunch=73b3a03997e9d04800d0112b50b3fbad --binary-syntax --close-stderr

This has been an issue for some time (#28077 and more recently #37101).

The problem appears to be coming from g_dbus_address_get_for_bus_sync() in the GIO GDbus interface. Enabling GDbus address debugging

export G_DBUS_DEBUG=address

shows the following

GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
GDBus-debug:Address: Running `dbus-launch --autolaunch=73b3a03997e9d04800d0112b50b3fbad --binary-syntax --close-stderr' to get bus address (possibly autolaunching)

In fact, a code inspection shows that GDBus only provides support for Unix and Windows platforms and shows Mac OS X support as a TODO.

Attached is a proposed patch that adds MacPorts specific dbus session support by using launchctl to lookup the dbus session socket and form the appropriate address from that.

After applying this patch, most if not all occurrences seem to be fixed. I have seen no problems after upgrading all outstanding GNOME ports to the 2.32.1 level including gconf.

Typical debug output is now

GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
GDBus-debug:Address: launchctl command line: `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET'
GDBus-debug:Address: launchctl stdout:
  0000: 2f 74 6d 70  2f 6c 61 75  6e 63 68 2d  4b 4a 57 39    /tmp/launch-KJW9
  0010: 72 7a 2f 75  6e 69 78 5f  64 6f 6d 61  69 6e 5f 6c    rz/unix_domain_l
  0020: 69 73 74 65  6e 65 72 0a  00                          istener..
GDBus-debug:Address: Returning address `unix:path=/tmp/launch-KJW9rz/unix_domain_listener' for bus type `session'

Submitting as an enhancement since this is not strictly a bug but a lack of upstream support. Propose submitting to upstream after wider testing by others.

Attachments (2)

patch-get-launchd-dbus-session-address.diff (3.7 KB) - added by dbevans (David B. Evans) 11 years ago.
Proposed patch
Portfile (5.3 KB) - added by dbevans (David B. Evans) 11 years ago.
Portfile to go with patch

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by dbevans (David B. Evans)

Proposed patch

comment:1 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Changed 11 years ago by dbevans (David B. Evans)

Attachment: Portfile added

Portfile to go with patch

comment:2 Changed 11 years ago by dbevans (David B. Evans)

I see I got in a hurry and forgot the Portfile to go with the patch. See attached. Sorry.

comment:3 Changed 11 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Committed in r107003, no negative response from maintainer.

Note: See TracTickets for help on using tickets.