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 685713 - ESourceRegistry's manager thread aborts on error
ESourceRegistry's manager thread aborts on error
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
3.6.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2012-10-08 11:51 UTC by Chris Coulson
Modified: 2012-10-10 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't abort in e_source_registry_new* when an error occurs (5.31 KB, patch)
2012-10-08 11:51 UTC, Chris Coulson
reviewed Details | Review

Description Chris Coulson 2012-10-08 11:51:22 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.
Comment 1 Matthew Barnes 2012-10-08 12:50:26 UTC
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?
Comment 2 Matthew Barnes 2012-10-09 13:02:44 UTC
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.
Comment 3 Charles Kerr 2012-10-09 22:59:55 UTC
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
Comment 4 Matthew Barnes 2012-10-10 11:34:38 UTC
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
Comment 5 Matthew Barnes 2012-10-10 12:53:48 UTC
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