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 658340 - empathy-chat crashes when I pick “Add Contact…”
empathy-chat crashes when I pick “Add Contact…”
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-06 09:50 UTC by Will Thompson
Modified: 2011-09-06 17:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
IndividualManager: disconnect handler from aggregator (1.20 KB, patch)
2011-09-06 10:08 UTC, Will Thompson
committed Details | Review

Description Will Thompson 2011-09-06 09:50:41 UTC
Steps to reproduce:

1. In the Contact List, choose Chat → New Conversation…
2. Enter the JID of a contact who's not on the contact list, and hit Chat
3. In the conversation window, pick Contact → Add Contact…

Expected results:

The New Contact dialog should appear for the contact.

Actual results:

Actually, for the first tab ever in an empathy-chat process, the “Add Contact…” item just doesn't exist… But in subsequent tabs (note that closing and reopening the tab is enough, there don't have to be >1 tabs open), it's present. When I pick it, the dialog pops up, but then empathy-chat segfaults:


  • #0 g_type_check_instance
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gtype.c line 4068
  • #1 g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 2917
  • #2 g_signal_emit
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3040
  • #3 aggregator_individuals_changed_cb
    at empathy-individual-manager.c line 222
  • #4 ??
    from /usr/lib/libfolks.so.25
  • #5 g_closure_invoke
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gclosure.c line 767
  • #6 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3252
  • #7 g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 2983
  • #8 g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3077
  • #9 ??
    from /usr/lib/libfolks.so.25
  • #10 ??
    from /usr/lib/libfolks.so.25
  • #11 ??
    from /usr/lib/libfolks.so.25
  • #12 g_closure_invoke
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3252
  • #14 g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 2983
  • #15 g_signal_emit_by_name
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3077
  • #16 _folks_persona_store_emit_personas_changed
    from /usr/lib/libfolks.so.25
  • #17 ??
    from /usr/lib/folks/25/backends/key-file/key-file.so
  • #18 load_contents_close_callback
    at /tmp/buildd/glib2.0-2.28.6/./gio/gfile.c line 6262
  • #19 async_ready_close_callback_wrapper
    at /tmp/buildd/glib2.0-2.28.6/./gio/ginputstream.c line 484
  • #20 complete_in_idle_cb_for_thread
    at /tmp/buildd/glib2.0-2.28.6/./gio/gsimpleasyncresult.c line 812
  • #21 g_main_dispatch
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 2440
  • #22 g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 3013
  • #23 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 3091
  • #24 g_main_loop_run
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 3299
  • #25 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #26 g_application_run
    at /tmp/buildd/glib2.0-2.28.6/./gio/gapplication.c line 1322
  • #27 main
    at empathy-chat.c line 160

It seems that 'self' (passed as user_data to aggregator_individuals_changed_cb) is garbage. This seems to be because the EmpathyIndividualManager object gets constructed and then immediately disposed when I hit Add Contact…; but the callback is never disconnected.
Comment 1 Will Thompson 2011-09-06 10:04:36 UTC
The EmpathyIndividualManager is constructed by empathy_contact_get_persona, which calls empathy_individual_manager_dup_singleton() and shortly afterwards g_object_unref()s what it returns.

Its FolksIndividualAggregator outlives it because empathy_individual_manager_init() calls folks_individual_aggregator_prepare(). There's no callback passed, but I assume it's alive because that pending operation is in progress. Regardless, not disconnecting the signal handler is a bug.

(Orthogonally: perhaps the singleton should be kept alive for the lifetime of empathy-chat? Might this stop Folks re-downloading everything?)
Comment 2 Will Thompson 2011-09-06 10:08:39 UTC
Created attachment 195768 [details] [review]
IndividualManager: disconnect handler from aggregator

Previously, the handler for
FolksIndividualAggregator::individuals-changed was never disconnected;
thus it could be called after EmpathyIndividualManager dies (if its
aggregator outlives it), and crash us.
Comment 3 Guillaume Desmottes 2011-09-06 16:25:35 UTC
Review of attachment 195768 [details] [review]:

++
Comment 4 Will Thompson 2011-09-06 17:35:00 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.