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 657266 - empathy crashed with SIGSEGV in folks_persona_store_get_can_alias_personas()
empathy crashed with SIGSEGV in folks_persona_store_get_can_alias_personas()
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Meta Contacts
3.1.x
Other Linux
: Normal critical
: 3.2
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-24 17:25 UTC by Cristian Aravena Romero
Modified: 2011-09-02 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
empathy_connection_can_add_personas: check if connection is connected (960 bytes, patch)
2011-08-30 08:44 UTC, Guillaume Desmottes
reviewed Details | Review
empathy_connection_can_*_personas: check if connection is connected (1.69 KB, patch)
2011-08-31 08:27 UTC, Guillaume Desmottes
committed Details | Review

Description Cristian Aravena Romero 2011-08-24 17:25:21 UTC
Open bug in lauchpand.net:
https://bugs.launchpad.net/bugs/831809

"Crashed after merging contacts"

  • #0 folks_persona_store_get_can_alias_personas
    at persona-store.c line 559
  • #1 empathy_connection_can_alias_personas
    at empathy-utils.c line 805
  • #2 empathy_individual_edit_menu_item_new
    at empathy-individual-menu.c line 927
  • #3 constructed
    at empathy-individual-menu.c line 330
  • #4 g_object_newv
    at /build/buildd/glib2.0-2.29.16/./gobject/gobject.c line 1521
  • #5 g_object_new_valist
    at /build/buildd/glib2.0-2.29.16/./gobject/gobject.c line 1610
  • #6 g_object_new
    at /build/buildd/glib2.0-2.29.16/./gobject/gobject.c line 1325
  • #7 empathy_individual_view_get_individual_menu
    at empathy-individual-view.c line 2619
  • #8 individual_view_popup_menu_idle_cb
    at empathy-individual-view.c line 928
  • #9 g_main_dispatch
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 2439
  • #10 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3008
  • #11 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3086
  • #12 g_main_loop_run
    at /build/buildd/glib2.0-2.29.16/./glib/gmain.c line 3294
  • #13 gtk_main
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtkmain.c line 1367
  • #14 g_application_run
    at /build/buildd/glib2.0-2.29.16/./gio/gapplication.c line 1325
  • #15 main
    at empathy.c line 788

Comment 1 Guillaume Desmottes 2011-08-25 08:43:04 UTC
Package: empathy 3.1.5.1-1ubuntu1
Comment 2 Travis Reitter 2011-08-27 01:09:39 UTC
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.
Comment 3 Travis Reitter 2011-08-28 19:53:56 UTC
(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.
Comment 4 Guillaume Desmottes 2011-08-29 08:16:01 UTC
So what's the right fix for this? Should Empathy just cope with empathy_dup_persona_store_for_connection() returning NULL?
Comment 5 Travis Reitter 2011-08-29 15:58:35 UTC
(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).
Comment 6 Guillaume Desmottes 2011-08-30 08:42:10 UTC
(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.
Comment 7 Guillaume Desmottes 2011-08-30 08:44:19 UTC
Created attachment 195163 [details] [review]
empathy_connection_can_add_personas: check if connection is connected
Comment 8 Travis Reitter 2011-08-30 22:46:18 UTC
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
Comment 9 Guillaume Desmottes 2011-08-31 08:27:35 UTC
Created attachment 195274 [details] [review]
empathy_connection_can_*_personas: check if connection is connected
Comment 10 Guillaume Desmottes 2011-09-02 13:21:42 UTC
Attachment 195274 [details] pushed as 8d3d11d - empathy_connection_can_*_personas: check if connection is connected