[Bug 104956] dimap: sudden mail loss

Pierre Habouzit madcoder at debian.org
Wed Jun 28 20:29:22 UTC 2006


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=104956         




------- Additional Comments From madcoder debian org  2006-06-28 22:29 -------
Le mer 28 juin 2006 22:16, Rob Kaper a écrit :

> (I swear, if I find the time I'll just have to get back to KDE
> development.)



well, following my previous remarks, I've grepped kmail sources 
for 'uidcache' in the kmail directory of kdepim sources. here is what I 
found:

  there is a nice function:
    KMFolderCachedImap::readUidCache that returns -1 if something failed
    at read time (that's good).

  there is a less nice function:
    KMFolderCachedImap::writeUidCache that returns errno (not knowing if
    it's set or not if we believe the comment) on error.

    meaning that here already, there is undefined behaviour on the
    uidcache files.

let's see where those are used:

  * readUidCache is used only in KMFolderCachedImap constructor:

    KMFolderCachedImap::KMFolderCachedImap( KMFolder* folder,
                                            const char* aName )
        : [ lots of initializations ]
    {
        setUidValidity("");
        readUidCache();
        mProgress = 0;
    }

    *BOOOOOOOOOOOOOOOHHHHH* that's horrible, if the uidcache reading
    fail we skip that silently BOOOH BOOOH BOOH THAT'S HORRIBLE ! and is
    obviously a first cause for a crash, because in taht case lots and
    lots of members are not initialized correctly.


  * writeUidCache is used many times. and the (innacurate) return value
    is actually *NEVER EVER* used. so kmail just assumes it has been
    written.

    BOOOOOOOOOOOOOOOOOOOOOOOH again


I'm almost sure that fixing that will fix 99% of the dimap mail losses. 
I'll see if I can create a patch of this, but I'm not very sure, I 
don't know kmail's code at all.



More information about the pkg-kde-bugs-fwd mailing list