GNOME Bugzilla – Bug 658340
empathy-chat crashes when I pick “Add Contact…”
Last modified: 2011-09-06 17:35:00 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:
+ Trace 228352
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.
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?)
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.
Review of attachment 195768 [details] [review]: ++
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.