Summary: | kmailcvt maxes out CPU and locks up on mbox import | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Tristan Miller <psychonaut> |
Component: | kmailcvt | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | The mbox I tried to import |
Description
Tristan Miller
2005-06-04 21:30:36 UTC
Created attachment 11323 [details]
The mbox I tried to import
Here's the mbox I tried to import. No privacy issues involved as except for
one message it's all spam.
Same problem here. Some mbox'es get imported correctly, some hang at 99% and I have to kill kmailcvt. to #2: could you also send me a test mbox to reproduce? The problem is: this is not a correct mbox. This file contain binary data between some of the messages ("^@" in vi/less ). But I think mbox should never contain binary data. Because of this and a related bug in qt kmailcvt never reaches the end of file! SVN commit 427894 by dkukawka: - fixed problem with corrupted mbox, which contains binary data between mails. The bug is related to a bug/problem in QT3 with QFile::readline() and QFile::at() which returns wrong fileposition if the file contains binary data BUG: 106796 M +10 -2 filter_mbox.cxx --- trunk/KDE/kdepim/kmailcvt/filter_mbox.cxx #427893:427894 @@ -68,8 +68,9 @@ while ( ! mbox.atEnd() ) { KTempFile tmp; + unsigned long filepos = 0; /* comment by Danny: - * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only + * Don't use QTextStream to read from mbox, better use QDataStream. QTextStream only * support Unicode/Latin1/Locale. So you lost information from emails with * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64 * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you @@ -83,7 +84,14 @@ tmp.file()->writeBlock( input, l ); while ( ! mbox.atEnd() && (l = mbox.readLine(input.data(),MAX_LINE)) && ((seperate = input.data()).left(5) != "From ")) { - tmp.file()->writeBlock( input, l ); + tmp.file()->writeBlock( input, l ); + + // workaround to fix hang if a corrupted mbox contains some + // binary data, for more see bug #106796 + if (mbox.at() == filepos) + mbox.at(mbox.size()); + else + filepos = mbox.at(); } tmp.close(); first_msg = false; |