By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 1235 - Kmail: Occasional endless loop with IMAP checking
Summary: Kmail: Occasional endless loop with IMAP checking
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdepim (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: All Linux
: P5 major
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2012-09-23 17:22 CDT by Kris
Modified: 2012-10-19 15:56 CDT (History)
4 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
kdepim: FIx (again) the addquotes/removequots functions (936 bytes, patch)
2012-09-25 04:23 CDT, Francois Andriot
Details | Diff
kdepim: FIx (again) the addquotes/removequots functions (2) (1.30 KB, patch)
2012-09-26 03:37 CDT, Francois Andriot
Details | Diff
kdepim: Fix more SEGV in imapparser (1.12 KB, patch)
2012-09-26 03:46 CDT, Francois Andriot
Details | Diff
kdepim : fix another endless loop (398 bytes, patch)
2012-09-26 08:10 CDT, Francois Andriot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kris 2012-09-23 17:22:48 CDT
On occaision (about once every one or two weeks), Kmail will start an endless loop of check and rechecking my IMAP accounts. No matter how many times I try to abort the checks, it keeps spawning more and more checks. The only way to make it stop is to close Kmail/Korganizer and reload it, after which it will resume normal operation (check each account once, then wait whatever amount of time I've set the check interval to or until I request a manual check, then wait again).

I am using cached IMAP with SSL enabled. I'm not sure if this will affect non-secured IMAP or non-cached IMAP, nor can I test if this affects POP since both of my accounts are using IMAP.
Comment 1 Francois Andriot 2012-09-25 02:59:28 CDT
I too have this problem.
There is definitely a problem in kio_imap when parsing some special caracters and/or quotes.

Look at bug #1009 : I think it's the same bug again.
Comment 2 Francois Andriot 2012-09-25 04:23:35 CDT
Created attachment 826 [details]
kdepim: FIx (again) the addquotes/removequots functions

Here is a patch for 3.5.13.1 that enhances (again) the addquotes/removequots functions in libkmime.
I have no more "unknown" messages in big Imap folders, I hope I will also have no crash at all.
Comment 3 Slávek Banko 2012-09-25 05:43:01 CDT
It seems like a lot of hot candidate for inclusion before the official release 3.5.13.1.
Comment 4 Francois Andriot 2012-09-25 06:56:01 CDT
Pfff now I have segfaults again in imapparser.cpp ...
There are some strangeness in the code, I will push another patch soon.
Comment 5 Slávek Banko 2012-09-25 10:27:54 CDT
(Odpověď na komentář #4)
> Pfff now I have segfaults again in imapparser.cpp ...
> There are some strangeness in the code, I will push another patch soon.

I've tried the patch, and even in a box with lots of garbage (samples for learning spam) I have not seen the accident. Only filtering in such a large folder is sometime very slow (60.000 emails).
Comment 6 Kris 2012-09-25 12:37:32 CDT
(In reply to comment #1)
> I too have this problem.
> There is definitely a problem in kio_imap when parsing some special caracters
> and/or quotes.
> 
> Look at bug #1009 : I think it's the same bug again.

That cannot be the same issue. My Kmail doesn't hang, nor does it use 100% CPU. It simply loops through rechecking my IMAP accounts until I close it. In addition, all my folders have relatively few messages (between 0 and 20 messages per folder, four folders per account, two accounts).
Comment 7 Slávek Banko 2012-09-25 12:46:20 CDT
Now I remember that I had a same problem on the original 3.5.13, which was a problem with non-ascii characters in the name of the folders. After solving the problem with non-ascii characters for me problem with infinite checking disappeared.
Comment 8 Kris 2012-09-25 12:52:15 CDT
(In reply to comment #7)
> Now I remember that I had a same problem on the original 3.5.13, which was a
> problem with non-ascii characters in the name of the folders. After solving the
> problem with non-ascii characters for me problem with infinite checking
> disappeared.

Unfortunately, I cannot control how Google names the folders. However, AFAIK, all the characters are ASCII.

If it is the same bug as yours, it must be something random (maybe the specific packages installed, or specific configuration combinations within PIM apps). I don't remember seeing that in 3.5.13, and this only came up within the past month after running a dist-upgrade on my Debian install.
Comment 9 Kris 2012-09-25 12:56:45 CDT
(In reply to comment #8)
> (In reply to comment #7)
> > Now I remember that I had a same problem on the original 3.5.13, which was a
> > problem with non-ascii characters in the name of the folders. After solving the
> > problem with non-ascii characters for me problem with infinite checking
> > disappeared.
> 
> Unfortunately, I cannot control how Google names the folders. However, AFAIK,
> all the characters are ASCII.
> 
> If it is the same bug as yours, it must be something random (maybe the specific
> packages installed, or specific configuration combinations within PIM apps). I
> don't remember seeing that in 3.5.13, and this only came up within the past
> month after running a dist-upgrade on my Debian install.

The only updates that had showed on that particular dist-upgrade were R14 nightlies. I do not recall seeing any updates from Debian.
Comment 10 Francois Andriot 2012-09-26 03:37:16 CDT
Created attachment 827 [details]
kdepim: FIx (again) the addquotes/removequots functions (2)
Comment 11 Francois Andriot 2012-09-26 03:46:51 CDT
Created attachment 828 [details]
kdepim: Fix more SEGV in imapparser

The attached patch adresses the following issues:
1) function "parseUntagged": check that string 'what' is not empty before parsing it (was causing SEGV)
2) function "parseLiteralC": fix parse string may not find '}' caracter  (was causing infinite loop)
Comment 12 Francois Andriot 2012-09-26 03:50:30 CDT
Slavek, please test the new 2 patches and if it works, push them in 3.5.13.1.
In the worst scenario they are useless, but should not cause any harm.
Comment 13 Francois Andriot 2012-09-26 08:10:42 CDT
Created attachment 829 [details]
kdepim : fix another endless loop
Comment 14 Slávek Banko 2012-09-26 10:01:57 CDT
Patched (all three patches), builded, tested, have not noticed any problems. I'm ready to push patches to git. Please, will be after a little time next patch? ;)
Comment 15 Francois Andriot 2012-09-26 10:23:54 CDT
No, no more quick patch for now  :-)
Comment 16 Slávek Banko 2012-09-26 12:17:09 CDT
Patches pushed to GIT in hash e09b1f3d, 590161fd a 786fea2f.
And also into v3.5.13-sru branch.