Summary: | excessive cpu usage while processing malformed headers | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Dirk Mueller <mueller> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | debian, kollix, vkrause |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | proposed patch |
Description
Dirk Mueller
2006-11-08 12:17:53 UTC
actually I cannot attach it but it is available under http://mirror.pusling.com/badmail further comment from Sune: Notice line 23 which is about 4-500 k of backslashes. 'litb' on #kde-devel talked about start writing a patch for this. I inspected Mail/inbox/cur and removed line 23 from that file - and after that there was no problems with the email. It looks like a bug in the header-parsing functions. Created attachment 18472 [details]
proposed patch
Johannes Schaub has created a patch for this
yeah, i created it and it works fine and _alot_ of faster than the old code. the email shows up within < 1s nice! using QString might be a good solution, given that QByteArray/QCString doesn't have a reserve() method for overcoming the O(n^2) behaviour. however, the local8Bit() conversion is wrong - it should be latin1. so dirk is saying that the patch would be fine after doing a s/local8Bit/latin1/ over the patch ? Or have I missed something? A official approved fix would be nice. /Sune I recall discussing this a little on irc. But I don't remember what we decided. Dirk, do you remember? Ingo? I also think Volker had a libkmime unit test for this. Please advise if I should commit Sune's patch. we have been shipping this patch in debian for a couple of months. We have gotten one report of some drawbacks with it, but I still consider them less important than a freezing kmail. A user writes: <quote> Since version 4:3.5.5.dfsg.1-2 kmail stopped treating correctly my name in the header. The last à in my last name is lost (strangely enough if I write it not in the last position of my name in the profile it works without problem). Prior to that version it worked without problem. I suspect the culprit is 18_optimize_splitAddressInternal.diff </quote> Original report is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405867 /Sune It would be great to have such a problematic mail to test with, as Qt4 now offers QByteArray::reserve(). Note: A quick test with a mail where the displayName field has about 700000 characters did not show a problem with the function shown in this patch (KPIMUtils::EmailParseResult splitAddressInternal) but with QByteArray::replace called from QUrl::setEncodedUrl called from KHTLPart ... So the problem I see lies within Qt - but maybe the original problem can still be shown ? Hello! Sorry to be the bearer of bad news, but this version of Kmail has been unmaintained for many years so I am closing this bug. Please try using the latest version of Kmail to see if your issue persists. If it does, please submit a new bug in "kmail2". Thank you! |