Summary: | KMail2 crash on viewing mail in gb2312 encoding, edit to UTF-8 fixes it | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Oliver <dev2> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | loox, montel |
Priority: | NOR | ||
Version: | 2.1.1 | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | 4.7.2 | |
Sentry Crash Report: |
Description
Oliver
2011-08-10 12:15:55 UTC
backtrace ? I try your method but works fine here no crash. I'm afraid the backtrace won't be of much help. I'll try to get kdepim to rebuild with debugging. This one is without: http://heesakkers.info/showandtell/kmail-20110817-235648.kcrash.txt Thanks. Perhaps you can forward email in private if possible. Perhaps I will able to reproduce it. The debugging rebuild was surprisingly simple: http://heesakkers.info/showandtell/kmail-20110818-003415.kcrash.txt pasting inline: Thread 3 (Thread 80fc041c0 (LWP 100481/kmail)): [KCrash Handler] #7 0x0000000802ea9717 in KMime::Content::decodedText () from /usr/local/kde4/lib/libkmime.so.5 #8 0x0000000808d4bea9 in MessageViewer::ObjectTreeParser::processTextHtmlSubtype () from /usr/local/kde4/lib/libmessageviewer.so.5 #9 0x0000000808cfde22 in (anonymous namespace)::TextHtmlBodyPartFormatter::process () from /usr/local/kde4/lib/libmessageviewer.so.5 #10 0x0000000808d5c648 in MessageViewer::ObjectTreeParser::parseObjectTreeInternal () from /usr/local/kde4/lib/libmessageviewer.so.5 #11 0x0000000808d8cb2e in MessageViewer::ViewerPrivate::parseContent () from /usr/local/kde4/lib/libmessageviewer.so.5 #12 0x0000000808d8e12b in MessageViewer::ViewerPrivate::displayMessage () from /usr/local/kde4/lib/libmessageviewer.so.5 #13 0x0000000808d90196 in MessageViewer::ViewerPrivate::updateReaderWin () from /usr/local/kde4/lib/libmessageviewer.so.5 #14 0x0000000808da1e3d in MessageViewer::ViewerPrivate::qt_metacall () from /usr/local/kde4/lib/libmessageviewer.so.5 #15 0x00000008049f877a in QMetaObject::activate () from /usr/local/lib/qt4/libQtCore.so.4 Christophe do you success to reproduce it ? no, maybe a real message using chinese symbols would help. I tested this with kdepim-4.7.1 and kdepimlibs-4.7.1 so YMMV The problem is a NULL pointer reference in Content::decodedText() , kmime/kmime_content.cpp This patch fixes it. The code is borrowed from Content::fromUnicodeString(). --- kmime/kmime_content.cpp.orig 2011-09-26 13:33:53.000000000 -0500 +++ kmime/kmime_content.cpp 2011-09-26 14:35:15.000000000 -0500 @@ -408,6 +408,12 @@ QTextCodec *codec = KGlobal::charsets()->codecForName( QLatin1String( contentType()->charset() ), ok ); + if ( !ok || codec == NULL ) { // no suitable codec found => try local settings and hope the best ;-) + codec = KGlobal::locale()->codecForEncoding(); + QByteArray chset = KGlobal::locale()->encoding(); + contentType()->setCharset( chset ); + } + QString s = codec->toUnicode( d_ptr->body.data(), d_ptr->body.length() ); if ( trimText || removeTrailingNewlines ) { Yes, patching kdepimlibs4 with this patch fixes the problem for me. Great work, thanks! Git commit 8fc508c5f90149f8b97e0f3560f81f92b2bea7ac by Montel Laurent. Committed on 27/09/2011 at 09:08. Pushed by mlaurent into branch 'master'. Fix Bug 279809 - KMail2 crash on viewing mail in gb2312 encoding, edit to UTF-8 fixes it Patch from Axel Gonzalez tested by Oliver The code is borrowed from Content::fromUnicodeString(). FIXED-IN:4.7.2 BUG: 279809 M +6 -1 kmime/kmime_content.cpp http://commits.kde.org/kdepimlibs/8fc508c5f90149f8b97e0f3560f81f92b2bea7ac Git commit 027da4d98f9b9099a51db4e8091de425acbea0f9 by Montel Laurent. Committed on 27/09/2011 at 09:08. Pushed by mlaurent into branch 'KDE/4.7'. Fix Bug 279809 - KMail2 crash on viewing mail in gb2312 encoding, edit to UTF-8 fixes it Patch from Axel Gonzalez tested by Oliver The code is borrowed from Content::fromUnicodeString(). FIXED-IN:4.7.2 BUG: 279809 (cherry picked from commit 8fc508c5f90149f8b97e0f3560f81f92b2bea7ac) M +6 -1 kmime/kmime_content.cpp http://commits.kde.org/kdepimlibs/027da4d98f9b9099a51db4e8091de425acbea0f9 Ok thanks for this patch. I applied to 4.7.2/master. Regards |