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 685498 - Aborts if accounts database can't be read
Aborts if accounts database can't be read
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: UOA
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2012-10-04 14:45 UTC by Iain Lane
Modified: 2012-10-08 08:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stacktrace (8.37 KB, text/plain)
2012-10-04 14:45 UTC, Iain Lane
  Details
deal if ag_manager_new_for_service_type() returns NULL (1.17 KB, patch)
2012-10-05 11:29 UTC, Guillaume Desmottes
none Details | Review
deal if ag_manager_new_for_service_type() returns NULL (3.82 KB, patch)
2012-10-08 08:49 UTC, Guillaume Desmottes
committed Details | Review

Description Iain Lane 2012-10-04 14:45:47 UTC
Created attachment 225814 [details]
stacktrace

This is a bug that I originally filed on Launchpad. See

  https://bugs.launchpad.net/ubuntu/+source/empathy/+bug/1059233

if you want to follow the exciting path that the issue has taken so far. :-)

Ubuntu ships an apparmor policy by default that restricts the paths that mission-control-5 (the binary) can access, including restrictions to the files in the home dir. The problem is that by default this is restricted to /home/*/.config/... Meaning that users with a different home directory or, in my case, a home directory which is a symlink to another part of the filesystem, get EACCES when libaccounts-glib tries to open the database.

This manifests itself in the UOA mc-plugin receving a NULL pointer when calling ag_manager_new_for_service_type at ubuntu-online-accounts/mc-plugin/mcp-account-manager-uoa.c:356. This is then passed to the constructor of empathy_webcredentials_monitor in ubuntu-online-accounts/mc-plugin/empathy-webcredentials-monitor.c, which then segfaults due to the assertion failure at line 91.

I don't think there's anything that UOA can do about not being able to access the accounts database. It just has to not segfault, but to fail gracefully instead.

Trace attached.
Comment 1 Iain Lane 2012-10-05 08:03:04 UTC
Oops, I said segfault but that's not true. The program aborts with SIGABRT due to the assertion failure.
Comment 2 Guillaume Desmottes 2012-10-05 11:29:16 UTC
Created attachment 225871 [details] [review]
deal if ag_manager_new_for_service_type() returns NULL

Looks like it may happen because of Ubuntu's apparmor policy. We can't do much
in this case but best to not crash MC at least.
Comment 3 Iain Lane 2012-10-05 12:11:01 UTC
Cheers. It resolves the crash for me. Empathy then gets into a confusing state where you can spawn the UOA dialog which shows all of your accounts but it doesn't know about or connect to any of them.

I doubt it's worth spending any effort on this edge case though.
Comment 4 Xavier Claessens 2012-10-08 08:47:41 UTC
I'm not sure it will deal with having self->priv->manager being NULL afterward. I would add a g_return_if_fail (self->priv->manager != NULL) in all exposed functions to be safe.

Maybe there is a way to tell MC to unload the plugin completely?
Comment 5 Guillaume Desmottes 2012-10-08 08:49:47 UTC
Created attachment 226019 [details] [review]
deal if ag_manager_new_for_service_type() returns NULL

Looks like it may happen because of Ubuntu's apparmor policy. We can't do much
in this case but best to not crash MC at least.
Comment 6 Xavier Claessens 2012-10-08 08:55:20 UTC
Yeah, seems safer like that IMO. +1
Comment 7 Guillaume Desmottes 2012-10-08 08:56:58 UTC
Attachment 226019 [details] pushed as 63c548d - deal if ag_manager_new_for_service_type() returns NULL