Bug 223509

Summary: The imap resource stops downloading after reaching a KMime assert (ASSERT: "enc->encoding() != Headers::CEbinary" in kmime/kmime_content.cpp:297)
Product: [Frameworks and Libraries] Akonadi Reporter: Christophe Marin <christophe>
Component: IMAP resourceAssignee: Kevin Ottens <ervin>
Status: RESOLVED FIXED    
Severity: normal CC: vkrause
Priority: NOR Keywords: akonadi-ports-regression
Version: 4.5   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 223438    
Attachments: mail source

Description Christophe Marin 2010-01-20 00:45:29 UTC
I added a DIMAP account, akonadi started downloading the messages and stopped at 8%.

akonadi log:

[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] akonadi_imap_resource_2(3112)/kdepimlibs (kimap) ImapResource::onHeadersReceived: Flags:  QSet("\Seen")                            
[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] akonadi_imap_resource_2(3112)/kdepimlibs (kimap) ImapResource::onHeadersReceived: Flags:  QSet("\Seen")                            
[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] akonadi_imap_resource_2(3112)/kdepimlibs (kimap) ImapResource::onHeadersReceived: Flags:  QSet("\Seen")                            
[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] akonadi_imap_resource_2(3112)/kdepimlibs (kimap) ImapResource::onHeadersReceived: Flags:  QSet("\Seen")                            
[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] ASSERT: "enc->encoding() != Headers::CEbinary" in file /kde/src/KDE/kdepimlibs/kmime/kmime_content.cpp, line 297                   
[/kde/inst/kdepim-runtime/bin/akonadi_imap_resource] KCrash: Application 'akonadi_imap_resource' crashing...                                                                            
ProcessControl: Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' stopped unexpected (Process crashed)                                                                   
Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' crashed to often. Giving up!                                                                                           
[akonadiserver] Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_imap_resource_2" , discarding cached interface                                                    
[akonadiserver] void Nepomuk::Search::QueryServiceClient::close()                                                                                                                       
[akonadiserver] "Cannot connect to agent instance with identifier 'akonadi_imap_resource_2', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_imap_resource_2': no such name'"                                                                                                                                                             
[akonadiserver] "Cannot connect to agent instance with identifier 'akonadi_imap_resource_2', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_imap_resource_2': no such name'"                                                                                                                                                             
[akonadiserver] "Cannot connect to agent instance with identifier 'akonadi_imap_resource_2', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_imap_resource_2': no such name'"

etc... 

(I'll try to get a backtrace)
Comment 1 Christophe Marin 2010-01-20 00:57:16 UTC
On the 2nd try, I got the bt:

Thread 1 (Thread 0xb47c3760 (LWP 3395)):
[KCrash Handler]
#6  0xffffe430 in __kernel_vsyscall ()
#7  0xb59bc0cf in raise () from /lib/libc.so.6
#8  0xb59bd9e7 in abort () from /lib/libc.so.6
#9  0xb7384774 in qt_message_output (msgType=QtFatalMsg, buf=0x6 <Address 0x6 out of bounds>) at global/qglobal.cpp:2250
#10 0xb7384993 in qt_message (msgType=QtFatalMsg, msg=0xb7500bbc "ASSERT: \"%s\" in file %s, line %d", ap=0xbff33474 "\264\247\066\266`\247\066\266)\001") at global/qglobal.cpp:2296
#11 0xb7384ab8 in qFatal (msg=0xb7500bbc "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2479
#12 0xb7384b35 in qt_assert (assertion=0xb636a7b4 "enc->encoding() != Headers::CEbinary", file=0xb636a760 "/kde/src/KDE/kdepimlibs/kmime/kmime_content.cpp", line=297) at global/qglobal.cpp:2013
#13 0xb6345df1 in KMime::Content::encodedContent (this=0x8244658, useCrLf=false) at /kde/src/KDE/kdepimlibs/kmime/kmime_content.cpp:297
#14 0xb6345fe5 in KMime::Content::encodedContent (this=0x8244870, useCrLf=false) at /kde/src/KDE/kdepimlibs/kmime/kmime_content.cpp:317
#15 0xb2ef85fa in Akonadi::SerializerPluginMail::serialize (this=0x81dadd8, item=..., label=..., data=..., version=@0xbff336ac) at /kde/src/KDE/kdepim-runtime/plugins/akonadi_serializer_mail.cpp:162
#16 0xb7739077 in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0xbff336ac) at /kde/src/KDE/kdepimlibs/akonadi/itemserializer.cpp:261
#17 0xb7738fad in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0xbff336ac) at /kde/src/KDE/kdepimlibs/akonadi/itemserializer.cpp:251
#18 0xb7729d1d in Akonadi::ItemCreateJob::doStart (this=0x834fc20) at /kde/src/KDE/kdepimlibs/akonadi/itemcreatejob.cpp:102
#19 0xb774d8c9 in Akonadi::JobPrivate::startQueued (this=0x834fc50) at /kde/src/KDE/kdepimlibs/akonadi/job.cpp:126
#20 0xb774dbf6 in Akonadi::JobPrivate::startNext (this=0x81fa148) at /kde/src/KDE/kdepimlibs/akonadi/job.cpp:162
#21 0xb774eebf in Akonadi::Job::qt_metacall (this=0x82252f8, _c=InvokeMetaMethod, _id=4, _a=0xbff3395c) at /kde/build/KDE/kdepimlibs/akonadi/job.moc:87
#22 0xb77a5158 in Akonadi::TransactionSequence::qt_metacall (this=0x82252f8, _c=InvokeMetaMethod, _id=32, _a=0xbff3395c) at /kde/build/KDE/kdepimlibs/akonadi/transactionsequence.moc:71
#23 0xb749beed in QMetaObject::metacall (object=0x82252f8, cl=3395, idx=32, argv=0xbff3395c) at kernel/qmetaobject.cpp:237
#24 0xb74aad1a in QMetaObject::activate (sender=0x83baf48, m=0xb75ac1a4, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3267
#25 0xb74b2995 in QSingleShotTimer::timeout (this=0x83baf48) at .moc/release-shared/qtimer.moc:82
#26 0xb74b2acc in QSingleShotTimer::timerEvent (this=0x83baf48) at kernel/qtimer.cpp:308
#27 0xb74a7824 in QObject::event (this=0x83baf48, e=0x6) at kernel/qobject.cpp:1204
#28 0xb69e777c in QApplicationPrivate::notify_helper (this=0x80cfae8, receiver=0x83baf48, e=0xbff33eb4) at kernel/qapplication.cpp:4298
#29 0xb69ee5c8 in QApplication::notify (this=0xbff341b8, receiver=0x83baf48, e=0xbff33eb4) at kernel/qapplication.cpp:4181
#30 0xb606c2a1 in KApplication::notify (this=0xbff341b8, receiver=0x83baf48, event=0xbff33eb4) at /usr/src/debug/kdelibs-4.4.59svn1074631/kdeui/kernel/kapplication.cpp:302
#31 0xb7496b7e in QCoreApplication::notifyInternal (this=0xbff341b8, receiver=0x83baf48, event=0xbff33eb4) at kernel/qcoreapplication.cpp:704
#32 0xb74c6d8e in sendEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qcoreapplication.h:215
#33 QTimerInfoList::activateTimers (event=<value optimized out>, receiver=<value optimized out>) at kernel/qeventdispatcher_unix.cpp:617
#34 0xb74c748f in QEventDispatcherUNIX::processEvents (this=0x80ba4f0, flags=) at kernel/qeventdispatcher_unix.cpp:938
#35 0xb6aa8a4a in QEventDispatcherX11::processEvents (this=0x80ba4f0, flags=...) at kernel/qeventdispatcher_x11.cpp:152
#36 0xb74951ed in QEventLoop::processEvents (this=0xbff34124, flags=) at kernel/qeventloop.cpp:149
#37 0xb7495639 in QEventLoop::exec (this=0xbff34124, flags=...) at kernel/qeventloop.cpp:201
#38 0xb74997b0 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#39 0xb69e7824 in QApplication::exec () at kernel/qapplication.cpp:3577
#40 0xb7769703 in Akonadi::ResourceBase::init (r=0x81e4188) at /kde/src/KDE/kdepimlibs/akonadi/resourcebase.cpp:219
#41 0x0807e094 in Akonadi::ResourceBase::init<ImapResource> (argc=3, argv=0xbff34294) at /kde/inst/kdepimlibs/include/akonadi/resourcebase.h:186
#42 0x08078fb0 in main (argc=3, argv=0xbff34294) at /kde/src/KDE/kdepim-runtime/resources/imap/imapresource.cpp:1898
Comment 2 Christophe Marin 2010-01-21 00:00:32 UTC
Created attachment 40084 [details]
mail source

the message source. only my address was changed
Comment 3 Thomas McGuire 2010-01-21 00:31:34 UTC
SVN commit 1077834 by tmcguire:

Don't assert here, I think it is wrong, the encoding can be binary at this point. In that case,
the body doesn't need to be encoded at all.

Add testcase for a bug where the assert is triggered.

Introduced in r1006180.

BUG: 223509


 M  +1 -3      kmime_content.cpp  
 M  +1 -0      tests/CMakeLists.txt  
 A             tests/data/mails/encoding-crash.mbox  
 M  +28 -12    tests/kmime_message_test.cpp  
 M  +6 -0      tests/kmime_message_test.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1077834