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 657914 - EmpathyIndividualStore segfaults if contact cannot be obtained by individual
EmpathyIndividualStore segfaults if contact cannot be obtained by individual
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Contact List
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
: 657125 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-01 10:09 UTC by Cosimo Alfarano
Modified: 2011-09-06 07:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible fix to the segfault (1.60 KB, patch)
2011-09-01 10:09 UTC, Cosimo Alfarano
none Details | Review
possible fix to the segfault (1.28 KB, patch)
2011-09-01 12:06 UTC, Cosimo Alfarano
committed Details | Review

Description Cosimo Alfarano 2011-09-01 10:09:42 UTC
Created attachment 195373 [details] [review]
possible fix to the segfault

I found a weird problem which lead to a segfault.

For some reasons there were some Individual that seemed empty, I think it was a problem related to telepathy-haze having problems.
I saw those contact in Empathy main windows as element in the buddy list with all the property empty. There were always another element with the same name with the correct information.

For example

"Mr Foo"
Account: my_foo
Identifier: Foo@Bar
Etc: ...some data

and then another contact

"Mr Foo"
Account: <empty>
Identifier: <empty>
Etc: <empty>


The latter one created the problem in EmpathyIndividualStore and when a contact was requested with empathy_contact_dup_from_folks_individual(ind) for example, it returned NULL.

This is clearly a problem somewhere else, but  empathy_contact_dup_from_folks_individual() is allowed to return NULL so null needs to be handled in individual_store_get_individual_status_icon_with_icon_name() as well.

Not handling it leads to segfaults in weird cases like it.


I tried to fix it here: http://cgit.collabora.com/git/user/kalfa/empathy.git/commit/?h=icon_from_contact_segfault&id=3479a7dc1387a990aa900e44215309ec82e8fda7

Not sure if it's the proper way to handle it, but it's the point to touch.

When contact is null, icon_name won't be set and g_hash_table_lookup(t,icon_name) will sefgault.


Note: as I used this patch, the empathy contacts disappeared for good, and I couldn't reproduce the bug anymore.
Comment 1 Cosimo Alfarano 2011-09-01 12:06:22 UTC
Created attachment 195378 [details] [review]
possible fix to the segfault

From the prev attach: removed a useless variable init, a leftover from a prev. approach.
Comment 2 Guillaume Desmottes 2011-09-01 12:55:47 UTC
Review of attachment 195378 [details] [review]:

++

That could be a folks issue actually, but yeah looks good.
Comment 3 Guillaume Desmottes 2011-09-06 07:06:00 UTC
*** Bug 657125 has been marked as a duplicate of this bug. ***