Bug 245531

Summary: Akonadi imap resource crashes occasionally
Product: [Frameworks and Libraries] Akonadi Reporter: Alex Merry <alex.merry>
Component: IMAP resourceAssignee: Kevin Ottens <ervin>
Status: RESOLVED WORKSFORME    
Severity: crash CC: amantia, balcaen.john, kde, kdepim-bugs, vkrause
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Alex Merry 2010-07-23 12:49:55 UTC
Application: akonadi_imap_resource (0.1)
KDE Platform Version: 4.4.93 (KDE 4.4.93 (KDE 4.5 >= 20100713)) (Compiled from sources)
Qt Version: 4.6.3
Operating System: Linux 2.6.34-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
I have three Akonadi imap resources set up, and two of them appear to crash quite frequently.  I can't tell which ones, so I don't know what configuration information might be relevant (although two are to remote hosts and one to the localhost, and this seems to happen more frequently on my VPN connection, which can be quite erratic).

Note that I don't know of any applications running that might be making use of these resources: KMail 2 isn't running, and neither is the Lionmail applet.

The crash can be reproduced some of the time.

-- Backtrace:
Application: Akonadi Resource (akonadi_imap_resource), signal: Aborted
[Current thread is 1 (Thread 0x7fd021980760 (LWP 7443))]

Thread 4 (Thread 0x7fd0096b3710 (LWP 7447)):
#0  0x00007fd01ca4ef43 in poll () from /lib/libc.so.6
#1  0x00007fd01ba58074 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007fd01ba585ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fd020e188d6 in QEventDispatcherGlib::processEvents (this=0x93b9e0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:414
#4  0x00007fd020def172 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fd020def3ac in QEventLoop::exec (this=0x7fd0096b2de0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007fd020d06c3f in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#7  0x00007fd01f8b2707 in KIMAP::SessionThread::run (this=0x9b97c0) at /home/kde-devel/src/KDE/kdepimlibs/kimap/sessionthread.cpp:167
#8  0x00007fd020d094d5 in QThreadPrivate::start (arg=0x9b97c0) at thread/qthread_unix.cpp:248
#9  0x00007fd020a7bcb0 in start_thread () from /lib/libpthread.so.0
#10 0x00007fd01ca577ad in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fd00d965710 (LWP 8766)):
#0  0x00007fd01ba57484 in g_main_context_query () from /usr/lib/libglib-2.0.so.0
#1  0x00007fd01ba57f7b in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007fd01ba585ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fd020e188d6 in QEventDispatcherGlib::processEvents (this=0x9aa730, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:414
#4  0x00007fd020def172 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fd020def3ac in QEventLoop::exec (this=0x7fd00d964de0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007fd020d06c3f in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#7  0x00007fd01f8b2707 in KIMAP::SessionThread::run (this=0x9e5530) at /home/kde-devel/src/KDE/kdepimlibs/kimap/sessionthread.cpp:167
#8  0x00007fd020d094d5 in QThreadPrivate::start (arg=0x9e5530) at thread/qthread_unix.cpp:248
#9  0x00007fd020a7bcb0 in start_thread () from /lib/libpthread.so.0
#10 0x00007fd01ca577ad in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fd00e166710 (LWP 8767)):
#0  0x00007fd020a80779 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fd020d09b02 in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x9f3880, time=30000) at thread/qwaitcondition_unix.cpp:85
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x9f3880, time=30000) at thread/qwaitcondition_unix.cpp:159
#3  0x00007fd020cffbf0 in QThreadPoolThread::run (this=0x9f3560) at concurrent/qthreadpool.cpp:140
#4  0x00007fd020d094d5 in QThreadPrivate::start (arg=0x9f3560) at thread/qthread_unix.cpp:248
#5  0x00007fd020a7bcb0 in start_thread () from /lib/libpthread.so.0
#6  0x00007fd01ca577ad in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fd021980760 (LWP 7443)):
[KCrash Handler]
#6  0x00007fd01c9bb565 in raise () from /lib/libc.so.6
#7  0x00007fd01c9bc9e6 in abort () from /lib/libc.so.6
#8  0x00007fd020d013af in qt_message_output (msgType=<value optimized out>, buf=<value optimized out>) at global/qglobal.cpp:2266
#9  0x00007fd020d0153d in qt_message (msgType=QtFatalMsg, msg=0x7fd020e4bf68 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff8f7ba3d0) at global/qglobal.cpp:2312
#10 0x00007fd020d016d5 in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2495
#11 0x00007fd02145a9d8 in Akonadi::CollectionSync::Private::processPendingRemoteNodes (this=0x9e38f0, _localRoot=0xbe2ea0) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/collectionsync.cpp:255
#12 0x00007fd02145bb3f in Akonadi::CollectionSync::Private::execute (this=0x9e38f0) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/collectionsync.cpp:450
#13 0x00007fd0214588ab in Akonadi::CollectionSync::setRemoteCollections (this=0x9ba410, remoteCollections=...) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/collectionsync.cpp:555
#14 0x00007fd0214c6d5d in Akonadi::ResourceBase::collectionsRetrieved (this=0x8ccd40, collections=...) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/resourcebase.cpp:385
#15 0x000000000041a194 in ImapResource::retrieveCollections (this=0x8ccd40) at /home/kde-devel/src/KDE/kdepim/runtime/resources/imap/imapresource.cpp:703
#16 0x00007fd0214c900b in Akonadi::ResourceBase::qt_metacall (this=0x8ccd40, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fff8f7baa20)
    at /home/kde-devel/build/KDE/kdepimlibs/akonadi/moc_resourcebase.cpp:111
#17 0x000000000042501d in ImapResource::qt_metacall (this=0x8ccd40, _c=QMetaObject::InvokeMetaMethod, _id=23, _a=0x7fff8f7baa20)
    at /home/kde-devel/build/KDE/kdepim/runtime/resources/imap/imapresource.moc:163
#18 0x00007fd020e03def in QMetaObject::activate (sender=0x8e8680, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3287
#19 0x00007fd0214cd1d5 in Akonadi::ResourceScheduler::executeCollectionTreeSync (this=0x8e8680) at /home/kde-devel/build/KDE/kdepimlibs/akonadi/resourcescheduler_p.moc:137
#20 0x00007fd0214cb20a in Akonadi::ResourceScheduler::executeNext (this=0x8e8680) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/resourcescheduler.cpp:244
#21 0x00007fd0214cd10c in Akonadi::ResourceScheduler::qt_metacall (this=0x8e8680, _c=QMetaObject::InvokeMetaMethod, _id=14, _a=0x7fff8f7bae80)
    at /home/kde-devel/build/KDE/kdepimlibs/akonadi/resourcescheduler_p.moc:113
#22 0x00007fd020e03def in QMetaObject::activate (sender=0x965ef0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3287
#23 0x00007fd020e08def in QSingleShotTimer::timerEvent (this=0x965ef0) at kernel/qtimer.cpp:308
#24 0x00007fd020e013ae in QObject::event (this=0x965ef0, e=0x7fff8f7bb620) at kernel/qobject.cpp:1204
#25 0x00007fd01ffc5ae4 in QApplicationPrivate::notify_helper (this=0x75ee20, receiver=0x965ef0, e=0x7fff8f7bb620) at kernel/qapplication.cpp:4302
#26 0x00007fd01ffc9bca in QApplication::notify (this=<value optimized out>, receiver=0x965ef0, e=0x7fff8f7bb620) at kernel/qapplication.cpp:4185
#27 0x00007fd01e08b9a5 in KApplication::notify (this=0x7fff8f7bb930, receiver=0x965ef0, event=0x7fff8f7bb620) at /home/kde-devel/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:309
#28 0x00007fd020defd8c in QCoreApplication::notifyInternal (this=0x7fff8f7bb930, receiver=0x965ef0, event=0x7fff8f7bb620) at kernel/qcoreapplication.cpp:726
#29 0x00007fd020e1b222 in QCoreApplication::sendEvent (this=0x762b70) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#30 QTimerInfoList::activateTimers (this=0x762b70) at kernel/qeventdispatcher_unix.cpp:603
#31 0x00007fd020e181f8 in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:184
#32 idleTimerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:231
#33 0x00007fd01ba57b33 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#34 0x00007fd01ba58310 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#35 0x00007fd01ba585ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#36 0x00007fd020e1887f in QEventDispatcherGlib::processEvents (this=0x71ed80, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#37 0x00007fd02006560e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#38 0x00007fd020def172 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#39 0x00007fd020def3ac in QEventLoop::exec (this=0x7fff8f7bb8a0, flags=...) at kernel/qeventloop.cpp:201
#40 0x00007fd020df37bb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1003
#41 0x00007fd0214c5b98 in Akonadi::ResourceBase::init (r=0x8ccd40) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/resourcebase.cpp:245
#42 0x000000000042b537 in Akonadi::ResourceBase::init<ImapResource> (argc=3, argv=0x7fff8f7bba88) at /home/kde-devel/kde/include/akonadi/resourcebase.h:186
#43 0x0000000000424f3c in main (argc=3, argv=0x7fff8f7bba88) at /home/kde-devel/src/KDE/kdepim/runtime/resources/imap/imapresource.cpp:2027

Reported using DrKonqi
Comment 1 Alex Merry 2010-07-26 13:26:37 UTC
I can confirm that this only happens with my remote accounts - I've disabled the local one, and I got two crashes again.
Comment 2 Alex Merry 2010-09-09 15:17:56 UTC
I don't get this in trunk any more.  Not tested recently with 4.5.
Comment 3 Balcaen John 2010-09-10 01:11:05 UTC
Created attachment 51494 [details]
New crash information added by DrKonqi

akonadi_imap_resource (0.1) on KDE Platform 4.5.67 (4.6 >= 20100901) using Qt 4.7.0

- What I was doing when the application crashed:
I was configuring my akonadi ressources to enable server-side subscriptions on gmail when akonadi-ressources imap crash.
It's also happening on my own imap server (dovecot) sometimes.

-- Backtrace (Reduced):
#11 0x00007ffafaef0dfe in Akonadi::CollectionSync::Private::processPendingRemoteNodes(LocalNode*) () from /usr/lib64/libakonadi-kde.so.4
#12 0x00007ffafaef2354 in Akonadi::CollectionSync::Private::execute() () from /usr/lib64/libakonadi-kde.so.4
#13 0x00007ffafaeee025 in Akonadi::CollectionSync::setRemoteCollections (this=0x235aa90, remoteCollections=<value optimized out>)
    at /usr/src/debug/kdepimlibs-4.5.67svn1170578/akonadi/collectionsync.cpp:555
#14 0x00007ffafaf5368e in Akonadi::ResourceBase::collectionsRetrieved (this=0x242f6b0, collections=...) at /usr/src/debug/kdepimlibs-4.5.67svn1170578/akonadi/resourcebase.cpp:385
#15 0x0000000000419950 in ResourceState::collectionsRetrieved (this=0x2566040, collections=...) at /usr/src/debug/kdepim-runtime-4.5.67svn1170578/resources/imap/resourcestate.cpp:338
Comment 4 Volker Krause 2010-12-30 13:56:25 UTC
*** Bug 246795 has been marked as a duplicate of this bug. ***
Comment 5 Kevin Ottens 2011-09-17 16:29:33 UTC
Is it still happening for you with 4.7.x? I've been unable to reproduce that one, it just works for me.

In case you still experience this please feel free to reopen. In such a case, we would need much more information like the actual IMAP server used, an idea of the IMAP traffic causing the crash and so on.
Comment 6 Christophe Marin 2011-11-18 15:09:56 UTC
just got the bt from 246795 with master, no idea why:

#5  0x00007f85aa191d94 in qt_assert (assertion=0x7f85aab36e4f "!localNode->processed", file=0x7f85aab36d30 "/kde/src/pim/kdepimlibs/akonadi/collectionsync.cpp", line=255) at global/qglobal.cpp:1999
#6  0x00007f85aaa37098 in Akonadi::CollectionSync::Private::processPendingRemoteNodes (this=0x5821d0, _localRoot=0x6d5e10) at /kde/src/pim/kdepimlibs/akonadi/collectionsync.cpp:255
#7  0x00007f85aaa3829c in Akonadi::CollectionSync::Private::execute (this=0x5821d0) at /kde/src/pim/kdepimlibs/akonadi/collectionsync.cpp:451
#8  0x00007f85aaa36262 in Akonadi::CollectionSync::Private::localCollectionFetchResult (this=0x5821d0, job=0x762cf0) at /kde/src/pim/kdepimlibs/akonadi/collectionsync.cpp:178
#9  0x00007f85aaa35321 in Akonadi::CollectionSync::qt_static_metacall (_o=0x6c3ed0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fff9cd38100) at /kde/build/pim/kdepimlibs/akonadi/collectionsync_p.moc:59
#10 0x00007f85aa2f14b8 in QMetaObject::activate (sender=0x762cf0, m=0x7f85a835f860, local_signal_index=3, argv=0x7fff9cd38100) at kernel/qobject.cpp:3547
#11 0x00007f85a81768cd in KJob::result (this=0x762cf0, _t1=0x762cf0) at /kde/build/kdelibs/kdecore/kjob.moc:208
#12 0x00007f85a8175d91 in KJob::emitResult (this=0x762cf0) at /kde/src/kdelibs/kdecore/jobs/kjob.cpp:312
#13 0x00007f85aaa9d102 in Akonadi::JobPrivate::delayedEmitResult (this=0x669d00) at /kde/src/pim/kdepimlibs/akonadi/job.cpp:144
#14 0x00007f85aaa9e20e in Akonadi::Job::qt_static_metacall (_o=0x762cf0, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0x6e0180) at /kde/build/pim/kdepimlibs/akonadi/job.moc:68
#15 0x00007f85aa2eaeeb in QMetaCallEvent::placeMetaCall (this=0x68bf70, object=0x762cf0) at kernel/qobject.cpp:525
#16 0x00007f85aa2ec129 in QObject::event (this=0x762cf0, e=0x68bf70) at kernel/qobject.cpp:1195
#17 0x00007f85a935ec2a in QApplicationPrivate::notify_helper (this=0x4bf0b0, receiver=0x762cf0, e=0x68bf70) at kernel/qapplication.cpp:4550
Comment 7 András Manţia 2012-11-21 11:06:14 UTC
Got it again with two imap resources crashing after resume from hibernation.