Bug 108281 - kmail hangs on some emails with adblock
Summary: kmail hangs on some emails with adblock
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Ivor Hewitt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-28 19:37 UTC by Christian Hesse
Modified: 2005-07-02 03:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
this email is one of the mails having the problem (6.55 KB, text/plain)
2005-06-28 19:42 UTC, Christian Hesse
Details
my adblock list (219 bytes, text/plain)
2005-06-30 12:42 UTC, Christian Hesse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hesse 2005-06-28 19:37:52 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8) 
OS:                Linux

I've downloaded Adblock v6 from [1], patched KDE 3.4.1, 
recompiled and installed everything. Adblocking in konqueror works just fine, 
but I have a problem with kmail. Kmail needs about ten seconds to open some 
of my mails, kmail is unresponsive at this time and cpu usage is at 100%. 
That mails are non html and I don't know what triggers the problem. Any 
ideas?

Installing kdelibs without the patch solves the problem, but konqueror can't block urls any longer.

[1] http://lists.kde.org/?l=kfm-devel&m=111533835616299&w=2
Comment 1 Christian Hesse 2005-06-28 19:42:09 UTC
Created attachment 11616 [details]
this email is one of the mails having the problem
Comment 2 Ivor Hewitt 2005-06-28 19:47:25 UTC
There's no html in that example message.
Comment 3 Christian Hesse 2005-06-28 20:21:02 UTC
You're right, there's no thml in the example message. Nevertheless, I see the described behaviour with this message.
Comment 4 David Faure 2005-06-29 00:08:43 UTC
KMail uses KHTML in all cases, even for non-HTML messages.
It generates HTML from the plain text mail, for rendering purposes.
Comment 5 Ivor Hewitt 2005-06-29 10:37:18 UTC
Ah, completely misread original post as saying non-html mails do not have the problem.

That sample opens instantly for me with AdBlock enabled.
If you simply disable filtering is it still slow to open that mail for you?
Comment 6 Christian Hesse 2005-06-29 11:36:10 UTC
No, disabled filtering solves the problem as well.
Comment 7 Ivor Hewitt 2005-06-29 12:21:23 UTC
OK please attach your adblock filter list, or alternatively try to systematically reduce your filter list to determine if a specific filter is causing problems.
Comment 8 Christian Hesse 2005-06-29 20:23:29 UTC
Seems to be a proportional relation: The more url expressions I add the longer kmail hangs.
Comment 9 Ivor Hewitt 2005-06-29 22:40:25 UTC
OK please supply some details of your filter list.
I have about 150 filters in my list and I don't see any noticeable slowdown with that mail message at all... and certainly not 10 seconds.
Comment 10 Christian Hesse 2005-06-30 12:42:15 UTC
Created attachment 11635 [details]
my adblock list

This is my adblock list that makes kmail hang for some seconds on some mails.
Reducing the list to the only entry "*/ads/*" kmail still hangs for half a
seconds (it's not long, but still noticable, especially when you click through
the mails with "Go to next unread message") on these mail.
Comment 11 Ivor Hewitt 2005-07-01 16:09:21 UTC
Ok, isAdFiltered is getting passed a 2k "data:image/png;base64..." url from the HTMLTokenizer when that message is opened, combined with your filter set that kills QRegExpEngine.
I'll add a url sanity check. Thanks.
Comment 12 Christian Hesse 2005-07-01 16:48:57 UTC
Ah, great news. ;)

Can you please post a link to the patch? Thanks.
Comment 13 Ivor Hewitt 2005-07-02 00:41:32 UTC
Commit:
http://lists.kde.org/?l=kde-commits&m=112025064627923&w=2
Comment 15 Seb Ruiz 2005-07-02 03:02:48 UTC
Fantastic, this also fixes a bug which I have experienced with amaroK since we started using data: urls in the context browser.

Thanks for the quick fix, ivor :-)