[Bug 258669] New: kmail/korganizer go into a tight loop, rapidly creating nearly empty emails in groupware/Calendar folder

Paul Millar paul at astro.gla.ac.uk
Fri Dec 3 11:46:24 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=258669

           Summary: kmail/korganizer go into a tight loop, rapidly
                    creating nearly empty emails in groupware/Calendar
                    folder
           Product: kontact
           Version: 4.4.5
          Platform: Debian unstable
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: NOR
         Component: general
        AssignedTo: kdepim-bugs at kde.org
        ReportedBy: paul at astro.gla.ac.uk


Version:           4.4.5 (using KDE 4.4.5) 
OS:                Linux

I am using KMail with a Disconnected IMAP account.  I have a "groupware" folder
on the IMAP server with the usual collection of subfolders: Calendar, Contacts,
Journal, Notes and Tasks.  The groupware folder uses the older Kolab1
(iCal/vCard) format.

I notice that sometimes, after I've created a new event in KOrganizer, the CPU
usage of the machine has a non-zero minimum value; i.e., the CPU peaks as
demand changes, but the CPU never drops below some fairly constant value.  This
is symptomatic of some process in some kind of tight(-ish) loop.

When investigating, using "top", I find a single process consuming most of the
CPU: "kontact".  From memory (so might be wrong) there's no indication within
kontact of any activity.

I restart kontact: menu: File->Quit then start it again.  Selecting "Check
Mail" results in KMail apparently getting stuck when synchronising the
groupware/Calendar folder.  Further investigation using icedove found a large
number of emails in this folder all submitted in very, very close succession,
suggesting they have been written at a rate of roughly 100 emails per second. 
Unfortunately, since there is little indication of a problem, it can be a while
before I notice.  One time, kontact/kmail created some 600,000 emails in the
directory before I stopped kontact.

These rapidly created emails are almost completely empty.  They don't contain
an iCal attachment and are missing basic header information like "From:" "To:".

At the beginning of the torrent of nearly-empty emails there is one containing
the correct details for the freshly created event.

It seems that kontact/korganizer/kmail is successful in writing the email but
then goes into a tight-loop writing these broken, mostly-empty emails.  My
suspicion is there's some kind of race-condition that can trigger a retry
strategy; however, this retry strategy is broken in this case.

In case it's useful, here's how I recover from the problem:
  1. stop kontact
  2. wait/ensure all kio_imap processes have finished.
  3. start icedove,
  4. select the groupware/Calendar folder,
  5. delete the mostly-empty emails and "compact" the folder,
  6. delete KMail's cache of groupware/Calendar folder: the maildir cache
directly in ~/.kde/share/apps/kmail/dimap/... ; I delete all of the three
subdirectories ("new", "cur" and "tmp").
  7. start kontact (I have kontact configured to show kmail view on startup),
  8. select "Check Mail", triggering kmail to recreate the local cache,
  9. Switch to Calendar view to verify that the event is still present;
recreate it if not.



Reproducible: Sometimes

Steps to Reproduce:
The problem is sporadic (happens approx once every month or so) and I haven't
been able to track down what triggers the problem.

It is possible the following procedure increases the likelihood of a problem:
  1. switch to kmail view,
  2. select the groupware/Calendar folder (one can see the emails with
attachments),
  3. switch to korganizer view,
  4. add an event,
  5. switch to kmail view,
  6. select "Check Mail" to synchronise email with IMAP server.

I now have kmail configure to hide the groupware folder, so cannot select this
folder.  So far, the problem hasn't reappeared, although I do not take this as
strong evidence that the problem has gone away.

Actual Results:  
sporadically kmail going into a tight-loop generating nearly-empty emails, as
described above.

Expected Results:  
I expect kontact/korganizer/kmail to save the event in the mailbox without
generating tons of broken emails.

IMHO the bug is more serious than "Normal".  It doesn't result in kontact
crashing so I've marked it as "Major".  Strictly speaking, this is wrong as I
believe there's no risk of data-loss.

Sorry, I don't know which component is at fault here (it might be kmail), so
I've marked the problem against kontact/generic.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list