Bug 117684 - Kmail crash when trying to open a message
Summary: Kmail crash when trying to open a message
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.8.3
Platform: FreeBSD Ports FreeBSD
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-05 00:16 UTC by amistry
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed fix (1.09 KB, patch)
2006-03-13 06:32 UTC, Ismail Onur Filiz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amistry 2005-12-05 00:16:39 UTC
Version:           1.8.3 (using KDE KDE 3.4.3)
Installed from:    FreeBSD Ports
OS:                FreeBSD

When I click on the following email, kmail just crashes with the following backtrace.  All the emails before and after it are fine, and deleting the index doesn't help.  I've tried to open it individually from a file and that too crashes kmail.

http://am-productions.biz/docs/kmail-crash.log
http://am-productions.biz/docs/kmail-crash-email.txt
Comment 1 Thiago Macieira 2005-12-05 04:21:42 UTC
Pasting the backtrace info:

[New LWP 100085]
[Switching to LWP 100085]
0x4a3a6eaf in wait4 () from /lib/libc.so.6
#0  0x4a3a6eaf in wait4 () from /lib/libc.so.6
#1  0x4a397123 in waitpid () from /lib/libc.so.6
#2  0x4a33f10a in waitpid () from /usr/lib/libpthread.so.2
#3  0x4986acc8 in KCrash::defaultCrashHandler ()
   from /usr/local/lib/libkdecore.so.6
#4  0x4a348ae6 in sigaction () from /usr/lib/libpthread.so.2
#5  0xbfbfff94 in ?? ()
#6  0x0000000b in ?? ()
#7  0xbfbfd3f0 in ?? ()
#8  0xbfbfd130 in ?? ()
#9  0x00000000 in ?? ()
#10 0x4a3481e0 in sigaction () from /usr/lib/libpthread.so.2
#11 0x48fa5fa2 in icalssutil_get_parts () from /usr/local/lib/libkcal.so.2
#12 0x48fa67a1 in icalclassify () from /usr/local/lib/libkcal.so.2
#13 0x48f36273 in KCal::ICalFormat::parseScheduleMessage ()
   from /usr/local/lib/libkcal.so.2
#14 0x48f44311 in KCal::IncidenceFormatter::formatICalInvitation ()
   from /usr/local/lib/libkcal.so.2
#15 0x4ab95b5d in (anonymous namespace)::Formatter::format ()
   from /usr/local/lib/kde3/libkmail_bodypartformatter_text_calendar.so
#16 0x483b512f in KMail::ObjectTreeParser::parseObjectTree ()
   from /usr/local/lib/libkmailprivate.so
#17 0x483b57ad in KMail::ObjectTreeParser::stdChildHandling ()
   from /usr/local/lib/libkmailprivate.so
#18 0x483b5afd in KMail::ObjectTreeParser::processMultiPartMixedSubtype ()
   from /usr/local/lib/libkmailprivate.so
#19 0x483bd0ab in (anonymous namespace)::MultiPartMixedBodyPartFormatter::process () from /usr/local/lib/libkmailprivate.so
#20 0x483b53be in KMail::ObjectTreeParser::parseObjectTree ()
   from /usr/local/lib/libkmailprivate.so
#21 0x482aa766 in KMReaderWin::parseMsg ()
   from /usr/local/lib/libkmailprivate.so
#22 0x482aafb3 in KMReaderWin::displayMessage ()
   from /usr/local/lib/libkmailprivate.so
#23 0x482ab18b in KMReaderWin::updateReaderWin ()
   from /usr/local/lib/libkmailprivate.so
#24 0x482ad1d0 in KMReaderWin::qt_invoke ()
   from /usr/local/lib/libkmailprivate.so
#25 0x49c7a854 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#26 0x49c7af72 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#27 0x49fc7da9 in QTimer::timeout () from /usr/X11R6/lib/libqt-mt.so.3
#28 0x49c9c35e in QTimer::event () from /usr/X11R6/lib/libqt-mt.so.3
#29 0x49c16ebf in QApplication::internalNotify ()
   from /usr/X11R6/lib/libqt-mt.so.3
#30 0x49c1705c in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#31 0x497cf078 in KApplication::notify () from /usr/local/lib/libkdecore.so.6
#32 0x49c0a69c in QEventLoop::activateTimers ()
   from /usr/X11R6/lib/libqt-mt.so.3
#33 0x49bc1f0b in QEventLoop::processEvents ()
   from /usr/X11R6/lib/libqt-mt.so.3
#34 0x49c2d532 in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#35 0x49c2d486 in QEventLoop::exec () from /usr/X11R6/lib/libqt-mt.so.3
#36 0x49c1606f in QApplication::exec () from /usr/X11R6/lib/libqt-mt.so.3
#37 0x0804a646 in main ()
Comment 2 Ismail Onur Filiz 2006-03-08 19:19:26 UTC
Please check bug 121382 and the solution there (downgrading libXft2) If this is the same situation, close the bug.
Comment 3 amistry 2006-03-12 22:24:12 UTC
I've checked that bug report and tried downgrading libXft and it doesn't fix the problem.  Also the crash emails provided in that bug report open just fine in my kmail.  It seems to be different problem.  Does the crash email open fine for you?  This isn't isolated to one machine.  I'm also getting the same behavior on an AMD64 box here too.
Comment 4 Ismail Onur Filiz 2006-03-13 06:32:22 UTC
Created attachment 15091 [details]
Proposed fix

The attached patch, which I haven't committed yet, solves the crashing problem.
Developers please have a look at it. Nevertheless, the ical parts are still not
read properly. That is something I leave for the more experienced at iCal code
;)
Comment 5 Ismail Onur Filiz 2006-03-13 08:19:16 UTC
I couldn't resist the temptation, and I worked on it a bit more:) So, my findings are:

*After the fix, the events are shown as follows:

This event has been published
What:  Summary unspecified
Where:  Location unspecified
Start Time:  2005-04-12 22:00
End Time:  2005-04-12 23:00
Duration:  1 hour 

The reason for that turns out to be corrupted '=' signs in the email file. i.e. '=' appears as '=3D'(hex for '=') in the file (Maybe that's how it should be, I don't know, in that case the ical parser is totally off). When I replaced them, this is the output:

This event has been published
What:  CHARSET=utf-8:Anish Mistry - Security Issues
Where: CHARSET=utf-8:Dreese Lab 113 (Lecture Hall)
Start Time:  2005-04-12 22:00
End Time:  2005-04-12 23:00
Duration:  1 hour

and, the RFC 2445 for iCal doesn't mention CHARSET as a property. That's probably why the output is not correct. The problem is, I think the parser shouldn't bail out on unknown properties, but should just ignore them. At this point, it looks like an ical problem than a kmail one, but I didn't know under which "product" it should then be listed, that's why I didn't change.
Comment 6 amistry 2006-03-13 16:55:18 UTC
Thanks.  No more crashing. :)
Comment 7 Ismail Onur Filiz 2006-03-14 16:44:16 UTC
SVN commit 518585 by onurf:

Fix crashes when the ical file doesn't have proper organizer or uid
fields.

Crashes are gone but still, the unknown parameters result in incorrect parsing
of the property. Ignoring the parameter looks like a better alternative.
See bugs 123620 and 117684.

BUG: 117684



 M  +8 -2      icalclassify.c  


--- branches/KDE/3.5/kdepim/libkcal/libical/src/libicalss/icalclassify.c #518584:518585
@@ -221,7 +221,10 @@
 
     p = icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY);
     if(p!=0){
-	parts->organizer = strdup(icalproperty_get_organizer(p));
+      const char *p_organizer = icalproperty_get_organizer(p);
+      if (p_organizer!=0) {
+        parts->organizer = strdup(p_organizer);
+      } 
     }
 
     p = icalcomponent_get_first_property(inner,ICAL_SEQUENCE_PROPERTY);    
@@ -231,7 +234,10 @@
 
     p = icalcomponent_get_first_property(inner,ICAL_UID_PROPERTY);
     if(p!=0){
-	parts->uid = strdup(icalproperty_get_uid(p));
+      const char *p_uid = icalproperty_get_uid(p);
+      if (p_uid!=0) {
+        parts->uid = strdup(p_uid);
+      } 
     }
 
     p = icalcomponent_get_first_property(inner,ICAL_RECURRENCEID_PROPERTY);