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 652015 - Patch to fix a crash in empathy-accounts
Patch to fix a crash in empathy-accounts
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Accounts
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-06-06 23:49 UTC by Roland Dreier
Modified: 2011-06-07 09:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
disconnect "password-retrieved" signal before disposing widget (1.26 KB, patch)
2011-06-06 23:49 UTC, Roland Dreier
none Details | Review

Description Roland Dreier 2011-06-06 23:49:47 UTC
Created attachment 189369 [details] [review]
disconnect "password-retrieved" signal before disposing widget

Hi, for a while I've been seeing a crash with empathy as follows:

 - one of my gtalk accounts has the wrong password
 - so when I start empathy, login fails of course
 - I get the little bar with "Authentication failed" in my main empathy window
 - but clicking on the "Edit Account" button launches empathy-accounts that crashes immediately in empathy_account_settings_get_string() (because settings is NULL)

I finally took some time to debug this.  What seems to happen is that when empathy-accounts gets started (in this case empathy spawns it as "/usr/bin/empathy-accounts --select-account=gabble/jabber/xxx..."), a settings widget gets created and as part of that the "password-retrieved" signal is hooked, and the underlying settings starts an asynchronous call to gnome keyring to get the password.

Then the code ends up in accounts_dialog_update_settings() which does the stuff near

  /* We have an account selected, destroy old settings and create a new
   * one for the account selected */

so the first account widget gets disposed before the gnome keyring call has finished.  As part of the dispose, the account widget does "priv->settings = NULL" and so when the "password-retrieved" signal finally comes in, we blow up.

The simplest fix seems to be to disconnect the password retrieved signal as part of the accounts widget dispose.  I've attached a patch that does this, which I've fixes the crash on my system.
Comment 1 Guillaume Desmottes 2011-06-07 09:43:06 UTC
Nice catch, thanks a lot! We have a convenient function to handle such case: tp_g_signal_connect_object(). I pushed another patch using it, making code simpler.


commit a662a6d379b9f619647a87a07177cc63d7133ad1
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Tue Jun 7 11:39:38 2011 +0200

    account-widget: use tp_g_signal_connect_object to connect on the password-retrieved signal (#652015)
    
    Thanks to Roland Dreier for the original patch.


Fixed in master and 3.0.


This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.