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 636714 - Reaches code that should not be reached
Reaches code that should not be reached
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: libfolks
0.3.x
Other Linux
: High major
: gnome-3.0
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2010-12-07 17:29 UTC by Paul van Tilburg
Modified: 2010-12-13 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb bt of empathy crash (2.52 KB, text/plain)
2010-12-07 17:29 UTC, Paul van Tilburg
  Details
Throw exceptions from IMable.normalise_im_address() instead of aborting due to an assertion failure (9.75 KB, patch)
2010-12-12 18:00 UTC, Philip Withnall
committed Details | Review

Description Paul van Tilburg 2010-12-07 17:29:49 UTC
Created attachment 176019 [details]
gdb bt of empathy crash

When starting Empathy I get the following error:

Core:ERROR:imable.c:308:folks_imable_normalise_im_address: code should not be reached

I have added the (useful part of the) traceback.
Comment 1 Paul van Tilburg 2010-12-07 22:37:37 UTC
I have worked around the problem by moving ~/.local/share/relationships.ini away, so apparently the problem is in this file.

I am not comfortable putting it online, please contact me privately if you want to have/see it.
Comment 2 Philip Withnall 2010-12-12 18:00:08 UTC
Created attachment 176301 [details] [review]
Throw exceptions from IMable.normalise_im_address() instead of aborting due to an assertion failure

http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/636714-normalise-im-address-exception

This patch fixes the problem by throwing an exception from IMable.normalise_im_address() if an invalid IM address is detected (note, however, that it doesn't claim to detect all invalid IM addresses at the moment). This allows the key-file code to ignore invalid IM addresses caused by corruption or incorrect editing of relationships.ini.

Paul, thanks for sending your relationships.ini to me; it was very helpful. I'd be interested to know how it got into the mess it's in though (the problem was being caused by truncated Jabber addresses which had somehow got into the file). I suspect it might be because of bug #628930. Has this relationships.ini file been used by a version of libfolks < 0.1.17 at all? Thanks.
Comment 3 Paul van Tilburg 2010-12-13 08:16:04 UTC
According to my aptitude log I have had 0.1.13, 0.1.15 and 0.1.16, but in the beginning I haven't used it much, i.e. for merging people.
Comment 4 Philip Withnall 2010-12-13 12:27:56 UTC
That makes sense. Linking contacts with folks < 0.1.17 would have corrupted relationships.ini (though it appears to have done so in a way which didn't render the entire file invalidly encoded). 0.1.17 would have worked fine with the corrupted relationships.ini, as it didn't have IM address normalisation. The crashing, if I'm correct, should've started as soon as you upgraded to ≥ 0.3.0. If that's the case, then the corruption was caused by bug #628930, and there should be nothing else to worry about.
Comment 5 Guillaume Desmottes 2010-12-13 13:37:41 UTC
Review of attachment 176301 [details] [review]:

The overall logic makes sense to me.
Comment 6 Paul van Tilburg 2010-12-13 15:17:28 UTC
I can confirm that the crashing started since the upgrade to 0.3.2.
Comment 7 Philip Withnall 2010-12-13 15:48:23 UTC
Merged to master, thanks.

commit f3ac848861074425cb88753ddddf124f4f7d358c
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Dec 12 17:52:52 2010 +0000

    Bug 636714 — Assertion failure on invalid IM address
    
    Handle invalid IM addresses in relationships.ini more gracefully by throwing
    an exception from IMable.normalise_im_address() if it detects an invalid
    address, rather than aborting due to an assertion failure. Closes: bgo#636714

 NEWS                                    |    3 +
 backends/key-file/kf-persona.vala       |   49 +++++++++++++++++++----
 backends/telepathy/lib/tpf-persona.vala |   12 +++++-
 folks/imable.vala                       |   65 ++++++++++++++++++++++++++----
 4 files changed, 109 insertions(+), 20 deletions(-)