GNOME Bugzilla – Bug 685713
ESourceRegistry's manager thread aborts on error
Last modified: 2012-10-10 13:02:24 UTC
Created attachment 226032 [details] [review] Don't abort in e_source_registry_new* when an error occurs The documentation for e_source_registry_new_sync says "If an error occurs in connecting to the D-Bus service, the function sets |error| and returns |NULL|". However, this is currently not the case, as it just causes the application to abort instead. This means that applications which link against libedataserver (for functionality which may not be essential for the running of it) now have a hard dependency against the whole evolution-data-server stack. The attached patch changes this so that the function behaves how I interpreted it is meant to behave from the documentation.
Makes sense, instantiation should fail gracefully with a GError. I'll give the patch a closer look shortly. Out of curiosity, in what application or context is this causing a problem?
Can you tell me a little more about your scenario that triggers the abort? I'm finding that even if the registry service can't be activated, the e_dbus_object_manager_client_new_for_bus_sync() call still returns without error. That's a little surprising, and leads me to wonder if there actually has to be no session bus present to get this thing to fail.
I'm not able to trigger this crash firsthand, but here's one log message from this abort: > msg = 0x7f368000b160 "Error calling StartServiceByName for org.gnome.evolution.dataserver.Sources0: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program /usr/lib/evolution/evolution-source-reg"... > msg_alloc = 0x7f368000b160 "Error calling StartServiceByName for org.gnome.evolution.dataserver.Sources0: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program /usr/lib/evolution/evolution-source-reg"... > i = 2 > #1 0x00007f3697dbfe42 in g_log (log_domain=log_domain@entry=0x7f3698e04b2e "e-data-server", log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x7f3698e0918c "%s") at /build/buildd/glib2.0-2.34.0/./glib/gmessages.c:1003 args = {{gp_offset = 32, fp_offset = 48, overflow_arg_area = 0x7f368c544c50, reg_save_area = 0x7f368c544b90}} > #2 0x00007f3698dec2c0 in source_registry_object_manager_thread (data=0x9bf0a0) at e-source-registry.c:740
I was able to reproduce the abort finally by running a small test program from a TTY. The process aborts with: (process:14313): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed (process:14313): e-data-server-ERROR **: Command line `dbus-launch --autolaunch=d1324f45fe5b724182257d3822f92500 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
I tweaked Chris' patch a bit, but it's essentially the same and works. Fixed for Evolution-Data-Server 3.7.1 and 3.6.1: http://git.gnome.org/browse/evolution-data-server/commit/?id=f47e935e450c132a48d6945cd553ec24b794c708 http://git.gnome.org/browse/evolution-data-server/commit/?h=gnome-3-6&id=b90353a272d34d2f1a11424c1c84385734c7d7fc