Bug 329162

Summary: Imap resource started crashing after I deleted a couple of e-mails
Product: [Frameworks and Libraries] Akonadi Reporter: Luis Silva <lacsilva>
Component: IMAP resourceAssignee: Christian Mollekopf <chrigi_1>
Status: RESOLVED DUPLICATE    
Severity: crash CC: honkir, kdepim-bugs, vkrause
Priority: NOR Keywords: drkonqi
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: New crash information added by DrKonqi

Description Luis Silva 2013-12-23 16:34:46 UTC
Application: akonadi_imap_resource (4.12)
KDE Platform Version: 4.12.0 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.11.0-15-generic i686
Distribution: Ubuntu 13.10

-- Information about the crash:
- What I was doing when the application crashed:
I deleted a couple of emails while kmail was fetching messages and the corresponding imap resource started crashing. It has been crashing ever since, no matter what I do, short of deleting the account and starting over.
I tried to restart akonadi but the resource keeps crashing.

The crash can be reproduced every time.

-- Backtrace:
Application: Leeds.ac.uk of type IMAP E-Mail Server (akonadi_imap_resource), signal: Aborted
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xb49dd740 (LWP 2716))]

Thread 2 (Thread 0xb207ab40 (LWP 2804)):
#0  0xb7794424 in __kernel_vsyscall ()
#1  0xb578b4d2 in clock_gettime (clock_id=1, tp=0xb2079ff8) at ../sysdeps/unix/clock_gettime.c:115
#2  0xb72293ec in do_gettime (frac=0xb2079ff0, sec=0xb2079fe8) at tools/qelapsedtimer_unix.cpp:123
#3  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#4  0xb730efd2 in updateCurrentTime (this=0xb1702074) at kernel/qeventdispatcher_unix.cpp:354
#5  QTimerInfoList::timerWait (this=0xb1702074, tm=...) at kernel/qeventdispatcher_unix.cpp:461
#6  0xb730d67b in timerSourcePrepareHelper (src=<optimized out>, timeout=0xb207a0ec) at kernel/qeventdispatcher_glib.cpp:136
#7  0xb730d70d in timerSourcePrepare (source=0xb1702040, timeout=0xb207a0ec) at kernel/qeventdispatcher_glib.cpp:169
#8  0xb547d143 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0
#9  0xb547da5f in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#10 0xb547dca8 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#11 0xb730d8df in QEventDispatcherGlib::processEvents (this=0xb1700468, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0xb72dc9f3 in QEventLoop::processEvents (this=this@entry=0xb207a258, flags=...) at kernel/qeventloop.cpp:149
#13 0xb72dcd19 in QEventLoop::exec (this=this@entry=0xb207a258, flags=...) at kernel/qeventloop.cpp:204
#14 0xb71cbe3d in QThread::exec (this=this@entry=0x99540e0) at thread/qthread.cpp:542
#15 0xb71cbf8b in QThread::run (this=0x99540e0) at thread/qthread.cpp:609
#16 0xb71ce72f in QThreadPrivate::start (arg=0x99540e0) at thread/qthread_unix.cpp:338
#17 0xb55acd78 in start_thread (arg=0xb207ab40) at pthread_create.c:311
#18 0xb577801e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131

Thread 1 (Thread 0xb49dd740 (LWP 2716)):
[KCrash Handler]
#7  0xb7794424 in __kernel_vsyscall ()
#8  0xb56b4aff in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#9  0xb56b8083 in __GI_abort () at abort.c:90
#10 0xb71c3993 in qt_message_output (msgType=QtFatalMsg, buf=0x997c8a0 "ASSERT: \"!isEmpty()\" in file /usr/include/qt4/QtCore/qlist.h, line 284") at global/qglobal.cpp:2347
#11 0xb71c3d47 in qt_message (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0xb7345aec "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0xbfb8d3f4 "Db\v\b\004b\v\b\034\001") at global/qglobal.cpp:2393
#12 0xb71c4278 in qFatal (msg=msg@entry=0xb7345aec "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2576
#13 0xb71c42f5 in qt_assert (assertion=0x80b6244 "!isEmpty()", file=0x80b6204 "/usr/include/qt4/QtCore/qlist.h", line=284) at global/qglobal.cpp:2021
#14 0x0808d457 in QList<long long>::last() ()
#15 0x0808cd0c in MoveItemsTask::recordNewUid() ()
#16 0x0808c956 in MoveItemsTask::onSearchDone(KJob*) ()
#17 0x080a60c4 in MoveItemsTask::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
#18 0xb72f2fc7 in QMetaObject::activate (sender=sender@entry=0x9984ea8, m=m@entry=0xb5beb4cc <KJob::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0xbfb8d5f8) at kernel/qobject.cpp:3539
#19 0xb5a471e5 in KJob::result (this=this@entry=0x9984ea8, _t1=_t1@entry=0x9984ea8) at ./kjob.moc:208
#20 0xb5a47232 in KJob::emitResult (this=0x9984ea8) at ../../kdecore/jobs/kjob.cpp:318
#21 0xb65167c9 in KIMAP::Job::handleErrorReplies(KIMAP::Message const&) () from /usr/lib/libkimap.so.4
#22 0xb65382eb in KIMAP::SearchJob::handleResponse(KIMAP::Message const&) () from /usr/lib/libkimap.so.4
#23 0xb652d681 in KIMAP::SessionPrivate::responseReceived(KIMAP::Message const&) () from /usr/lib/libkimap.so.4
#24 0xb652e995 in KIMAP::SessionPrivate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libkimap.so.4
#25 0xb72ef77a in QMetaCallEvent::placeMetaCall (this=0xb0bec160, object=0x9953f00) at kernel/qobject.cpp:524
#26 0xb72f758b in QObject::event (this=0x9953f00, e=0xb0bec160) at kernel/qobject.cpp:1194
#27 0xb67ef744 in QApplicationPrivate::notify_helper (this=0x97dacd0, receiver=0x9953f00, e=0xb0bec160) at kernel/qapplication.cpp:4567
#28 0xb67f6223 in QApplication::notify (this=0xbfb8dd94, receiver=receiver@entry=0x9953f00, e=e@entry=0xb0bec160) at kernel/qapplication.cpp:4353
#29 0xb5dc8164 in KApplication::notify (this=0xbfb8dd94, receiver=0x9953f00, event=0xb0bec160) at ../../kdeui/kernel/kapplication.cpp:311
#30 0xb72ddeda in QCoreApplication::notifyInternal (this=0xbfb8dd94, receiver=receiver@entry=0x9953f00, event=event@entry=0xb0bec160) at kernel/qcoreapplication.cpp:946
#31 0xb72e16ad in sendEvent (event=0xb0bec160, receiver=0x9953f00) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#32 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x97b5fd8) at kernel/qcoreapplication.cpp:1570
#33 0xb72e1bbc in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1463
#34 0xb730df6e in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#35 postEventSourceDispatch (s=0x97dadd0) at kernel/qeventdispatcher_glib.cpp:279
#36 0xb547d83e in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#37 0xb547dbe8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#38 0xb547dca8 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#39 0xb730d8bf in QEventDispatcherGlib::processEvents (this=this@entry=0x97b6b60, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#40 0xb68a432e in QGuiEventDispatcherGlib::processEvents (this=0x97b6b60, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#41 0xb72dc9f3 in QEventLoop::processEvents (this=this@entry=0xbfb8dcf8, flags=...) at kernel/qeventloop.cpp:149
#42 0xb72dcd19 in QEventLoop::exec (this=this@entry=0xbfb8dcf8, flags=...) at kernel/qeventloop.cpp:204
#43 0xb72e289e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#44 0xb67ed974 in QApplication::exec () at kernel/qapplication.cpp:3828
#45 0xb760728d in Akonadi::ResourceBase::init(Akonadi::ResourceBase*) () from /usr/lib/libakonadi-kde.so.4
#46 0x080630e0 in int Akonadi::ResourceBase::init<ImapResource>(int, char**) ()
#47 0x08060be3 in main ()

Possible duplicates by query: bug 324432, bug 321758, bug 316495, bug 313194, bug 313047.

Reported using DrKonqi
Comment 1 Luis Silva 2013-12-23 16:56:03 UTC
This is the output when starting from the terminal.

akonadi_imap_resource_2(5076) ImapResource::doSetOnline: online= true
Database "akonadi" opened using driver "QMYSQL" 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::LoginJob: KIMAP::LoginJob(0x89fcff0)
Database "akonadi" opened using driver "QMYSQL" 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::SessionThread::reconnect: connectToHost "outlook.leeds.ac.uk" 143
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::doStart: KIMAP::LoginJob(0x89fcff0)
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "StartTls" "A000001"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::SessionThread::sslConnected: TLS negotiation done.
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Capability" "*"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: Capabilities updated:  ("IMAP4", "IMAP4rev1", "AUTH=NTLM", "AUTH=GSSAPI", "AUTH=PLAIN", "IDLE", "NAMESPACE", "LITERAL+")
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Capability" "A000002"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Login" "+"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Login" "A000003"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::LoginJob::~LoginJob: KIMAP::LoginJob(0x89fcff0)
akonadi_imap_resource_2(5076) ImapResource::doSetOnline: online= true
akonadi_imap_resource_2(5076) ResourceState::item: Called item() while state holds multiple items! 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::doStart: "15020,15087,15180,15255,15279,15291,15372 +FLAGS (\Deleted)"
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
akonadi_imap_resource_2(5076)/kdepimlibs (kimap) KIMAP::StoreJob::handleResponse: We asked for UID but the server didn't give it back, resultingFlags not stored. 
ASSERT: "!isEmpty()" in file /usr/include/qt4/QtCore/qlist.h, line 284
KCrash: Application 'akonadi_imap_resource' crashing...
Comment 2 honkir 2013-12-26 18:40:23 UTC
Created attachment 84280 [details]
New crash information added by DrKonqi

akonadi_imap_resource (4.12) on KDE Platform 4.12.0 using Qt 4.8.4

- Unusual behavior I noticed:
Since I deleted one message in folter "spam" (IMAP account), the resource keeps crashing.

-- Backtrace (Reduced):
#7  0x0808d2ce in MoveItemsTask::recordNewUid (this=this@entry=0x9e529f0) at ../../../resources/imap/moveitemstask.cpp:290
#8  0x0808d903 in MoveItemsTask::onSearchDone (this=0x9e529f0, job=0x9de23e0) at ../../../resources/imap/moveitemstask.cpp:242
[...]
#10 0xb5ace1e5 in KJob::result (this=this@entry=0x9de23e0, _t1=_t1@entry=0x9de23e0) at ./kjob.moc:208
#11 0xb5ace232 in KJob::emitResult (this=0x9de23e0) at ../../kdecore/jobs/kjob.cpp:318
#12 0xb658f63e in KIMAP::Job::handleErrorReplies(KIMAP::Message const&) () from /usr/lib/libkimap.so.4
Comment 3 Jekyll Wu 2014-01-06 03:18:24 UTC

*** This bug has been marked as a duplicate of bug 328601 ***