Bug 59280 - Race Attachment Filters CPU
Summary: Race Attachment Filters CPU
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-03 14:09 UTC by Joseph Campbell
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Campbell 2003-06-03 14:09:56 UTC
Version:           1.5.2 (using KDE 3.1.1)
Installed from:    SuSE
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:          Linux (i686) release 2.4.20

I am unsure as to the exact nature of this problem as it may be unrelated to what I see.  It seems the starting with 1.5.1 and higher there is some set of conditions involving email attachments that is causing Kmail to eat up 100% of CPU time and never come back.  The attachment size does not seem to matter, could be very small or very large seems to happen either way.  The only thing that I have done "differently" of recent is to include in my filter list a few (about 5) regexp filters to aid in filtering out some spam.
Comment 1 Dominik Stadler 2003-06-03 17:22:50 UTC
This sounds like indeed the regular expressions are causing this. 

Maybe the regex is executed against all the text in the message (also
attachments are stored as some sort of text in the mail).

This can take very long for complicated regexes and mails with a bit of attachment.
Comment 2 Ingo Klöcker 2003-06-04 02:08:54 UTC
Subject: Re:  New: Race Attachment Filters CPU

We can't really do much about badly chosen regular expressions. The Qt 
implementation of regexp isn't very fast in some cases. So if some 
regexp seems to hang KMail then try to change it. One example of a 
regexp which should be avoided is a leading or a trailing ".*". This 
can be horribly slow if you search the complete message. It's anyway 
unnecessary because KMail always searches for substrings which match 
the regexp.

Please tell us which regexp filters you've added.

Comment 3 Joseph Campbell 2003-06-04 15:08:57 UTC
Ahh, that would certainly explain it.  I had one in there that did just that. 

.*<!--.*

Sorry to have used a bug reporting system as a listserve.  Thanks for the help.

Joe