GNOME Bugzilla – Bug 657266
empathy crashed with SIGSEGV in folks_persona_store_get_can_alias_personas()
Last modified: 2011-09-02 13:21:46 UTC
Open bug in lauchpand.net: https://bugs.launchpad.net/bugs/831809 "Crashed after merging contacts"
+ Trace 228187
Package: empathy 3.1.5.1-1ubuntu1
The fact that this crashes is due to bug #657481. But it's still a bug in Empathy. My guess is the root bug is that empathy_dup_persona_store_for_connection() should never return NULL.
(In reply to comment #2) > The fact that this crashes is due to bug #657481. But it's still a bug in > Empathy. > > My guess is the root bug is that empathy_dup_persona_store_for_connection() > should never return NULL. Apparently this can happen when activating cached personas.
So what's the right fix for this? Should Empathy just cope with empathy_dup_persona_store_for_connection() returning NULL?
(In reply to comment #4) > So what's the right fix for this? Should Empathy just cope with > empathy_dup_persona_store_for_connection() returning NULL? I think the fix is to first figure out why it's returning NULL. My guess at this point is that it's due to a cached TpfPersona. I believe they should have a non-NULL PersonaStore at all times, but it's possible the Empathy code returns a NULL PersonaStore in that function because it can't correlate the TpfPersona with the Connection (since the TpfPersona will have a NULL TpContact when we're offline). Are you sure you're passing a valid TpConnection into empathy_dup_persona_store_for_connection() when this bug happens? I would guess this happens while we're offline (and something is messed up like I suggested above). As long as we're offline, Folks won't be able to determine whether a TpfPersona can be aliased or grouped anyhow (since that comes from the CM, which ultimately gets it from the server). You probably don't want to include this logic in Empathy if you can avoid it, but if there's no other option, you could just return FALSE in empathy_connection_can_alias_personas() and empathy_connection_can_group_personas() when the TpfPersona you're dealing with is cached (its .contact is NULL).
(In reply to comment #5) > (In reply to comment #4) > Are you sure you're passing a valid TpConnection into > empathy_dup_persona_store_for_connection() when this bug happens? I would guess > this happens while we're offline (and something is messed up like I suggested > above). empathy_connection_can_alias_personas check that the connection is actually a TpConnection object (which it is in this case) but does not check if the connection is still connected. Adding that check makes sense as, as you said, we can't certainly do much with an offline account.
Created attachment 195163 [details] [review] empathy_connection_can_add_personas: check if connection is connected
Review of attachment 195163 [details] [review]: Looks fine to me, though I think you'll probably need a similar check for the equivalent empathy_connection_can_alias_personas() function
Created attachment 195274 [details] [review] empathy_connection_can_*_personas: check if connection is connected
Attachment 195274 [details] pushed as 8d3d11d - empathy_connection_can_*_personas: check if connection is connected