GNOME Bugzilla – Bug 635825
Ensure valid UTF8 strings are passed to GDBus/GVariant
Last modified: 2011-03-08 10:23:51 UTC
Created attachment 175290 [details] journal.ics file that's toxic to Evo 2.30.3's memo component Immediately after upgrading from 2.28.3 to 2.30.3, I could not open a specific memo folder without reproducibly causing Evo to give this error: "The Evolution memo has quit unexpectedly; Your memos will not be available until Evolution is restarted". Then none of the memos in that memo folder could be viewed. This memo folder worked fine in 2.28.3, so it would appear to be a regression. Through editing the journal.ics file in a binary search, I was able to narrow it down to a journal.ics containing just one memo. In gedit, I saw that this one memo contained non-ASCII characters. I kept a backup of the file, and then replaced or deleted the non-ASCII characters, restarted evolution, and then the memo folder & the single memo displayed without any problems. I then went through the full original journal.ics, tracking all down the non-ascii entries using this command: grep -P "[\x80-\xFF]" journal.ics ... and then deleting or replacing any non-ASCII characters. I also added a single line that contained each potentially bad character to the already known-bad journal.ics. At the end of this, I saved the full cleaned journal.ics, restarted Evo, and it worked beautifully in Evo 2.30.3. I am attaching the toxic journal.ics file to this bug report. Note that everything in this file comes from real-world data, so ideally Evo should be able to open a memo folder with this journal.ics. I'm even okay with Evo silently dropping/ignoring any non-ASCII characters, as that's preferable to the current behavior.
I think this is because 2.30 now uses GDBus instead of Bonobo to talk to the calendar daemon, and GDBus uses GVariant to marshal values between processes, and GVariant expects all strings to be in UTF-8, and I have found cases where GVariant crashes if given a string with invalid UTF-8 characters. I've already filed a bug about GVariant, but apparently we're missing an encoding conversion at some level. I only know this because I ran into the same crash a few months back with an old ICS file. It only contained test data, so I just deleted it and moved on.
Created commit 5063941 in eds master (2.91.3+) The problem is that GDBus/GVariant doesn't like non-UTF8 strings, and crashes with them. This commit ensures that anything passed into the GDBus/GVariant is UTF8 valid string.
Looks great, thank you very much for the speedy resolution.
*** Bug 635755 has been marked as a duplicate of this bug. ***
*** Bug 626142 has been marked as a duplicate of this bug. ***
*** Bug 644099 has been marked as a duplicate of this bug. ***
Will you be able to produce a patch for Evolution 2.32.x or will that have to wait until 3.x?
Such patch would be similar for a commit mentioned in comment #2. The "problem" with 2.32.x was that I thought it's too intrusive for stable version (though adding needed functionality, aka non-crashing application), and that there is not planned any other update on 2.32 branch. You might either ask your distro maintainer whether he/she will be willing to backport the above commit or just wait for 3.0. Of course, other option is to open local file and make it utf8 valid - the calendar.ics file is just a text file, so converting it to utf8 will be sufficient and will make GVariant happy again.
The bug I reported does not relate to the ICS, it's about a piece of spam that crashed Evolution. Plesae see the https://bugzilla.gnome.org/show_bug.cgi?id=644099 and test case that I reported yesterday for full details.
Oh, I'm sorry, I overlooked that (I didn't pay attention much on it, I'm sorry). Their "From" is containing garbage, and this From value is used to search addressbooks for inclusion, to know whether either download images and/or show senders photo. The above fix will fix it too. Workaround (though for a price of loosing a bit of functionality), go to Edit->Preferences->Mail Preferences->tab HTML Messages, choose other than "Load images if contact in my address book" option there and then also at Edit->Preferences->Mail Preferences->tab Headers, uncheck "Show photo of the sender" at the top of the tab. It will avoid checking address books.