Bug 246560

Summary: imap resource crashes repeatedly on sync
Product: [Applications] kontact Reporter: Robert Marmorstein <robert>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: crash CC: kde
Priority: NOR    
Version: SVN trunk   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Backtrace

Description Robert Marmorstein 2010-08-02 23:58:01 UTC
Created attachment 49760 [details]
Backtrace

Version:           SVN trunk (KDE 4) (using Devel) 
OS:                Linux

Every time I launch kontact (or any other Akonadi-enabled application) the imap_resource crashes repeatedly until Akonadi finally disables it.  The debug window in akonadiconsole gives:

AgentBase(akonadi_imap_resource_8): No message retrieved, server reply was empty.

Which may or may not be directly related to the message.

From looking at the backtrace (which I will attach), it seems that what is happening is that the "slotDeliveryDone" slot is activated while the current task is a "SyncCollection" task which triggers an assert since the resource expects only "itemFetch" tasks to be active then.

The IMAP server is a Kolab server which has both mail folders and calendars/contacts folders.

Synchronization never successfully completes and I am unable to "subscribe" to folders.  

Reproducible: Always

Steps to Reproduce:
Create an imap resource.  Try to synchronize it.  

Actual Results:  
An assert is hit.

Expected Results:  
Synchronization should complete successfully.
Comment 1 Robert Marmorstein 2010-08-02 23:59:26 UTC
One thing to note is that I pulled up the crashed process in gdb and did:

(gdb) p scheduler->currentTask().type
$4 = Akonadi::ResourceScheduler::SyncCollection

So, the current Task is a SyncCollection task.  There are some similar bugs, but none of them involve a SyncCollection task.  I tested this several times and this is always exactly what happens.  I've also deleted and recreated the resource several times with no change in behavior -- it still crashes.
Comment 2 Robert Marmorstein 2010-08-03 00:02:48 UTC
Oops.  I forgot that I'm not running latest trunk of kdepim.  This is with kdepimlibs-4.4 and kdepim-4.4.  Everything else on my system (kdelibs, kdebase, kdesupport, etc.) is running from latest trunk.
Comment 3 Nicolas L. 2010-08-15 15:25:19 UTC
From Comment #0 : 

Thread 1 (Thread 0x7f3592290760 (LWP 5224)):
[KCrash Handler]
#6  0x00007f358d902565 in raise () from /lib/libc.so.6
#7  0x00007f358d9039e6 in abort () from /lib/libc.so.6
#8  0x00007f35916bdc6e in qt_message_output (msgType=<value optimized out>, buf=<value optimized out>) at global/qglobal.cpp:2259
#9  0x00007f35916bdd4e in qt_message (msgType=QtFatalMsg, msg=0x7f35917a7e16 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff8e811ca0) at global/qglobal.cpp:2305
#10 0x00007f35916bde6d in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2488
#11 0x00007f3591dedac6 in Akonadi::ResourceBasePrivate::slotDeliveryDone (this=0xbcc310, job=0xd7ebf0) at /var/abs/local/eth-os/sources/KDE/kdepimlibs/akonadi/resourcebase.cpp:277
#12 0x00007f3591def2ec in Akonadi::ResourceBase::qt_metacall (this=0xbcad90, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fff8e811fd0)
    at /var/abs/local/eth-os/sources/KDE/kdepimlibs/build/akonadi/moc_resourcebase.cpp:115
#13 0x0000000000424d94 in ImapResource::qt_metacall (this=0xbcad90, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff8e811fd0)
    at /var/abs/local/eth-os/sources/KDE/kdepim/build/runtime/resources/imap/imapresource.moc:156
#14 0x00007f3591770f6f in QMetaObject::activate (sender=0xd7ebf0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff8e811fd0) at kernel/qobject.cpp:3272
#15 0x00007f358e4d39eb in KJob::result (this=<value optimized out>, _t1=0xd7ebf0) at /var/abs/local/eth-os/sources/KDE/kdelibs/build/kdecore/kjob.moc:194
#16 0x00007f358e4d3a25 in KJob::emitResult (this=0xd7ebf0) at /var/abs/local/eth-os/sources/KDE/kdelibs/kdecore/jobs/kjob.cpp:312
#17 0x00007f3591dd7ca4 in Akonadi::ItemModifyJob::doHandleResponse (this=0xd7ebf0, _tag=<value optimized out>, data=<value optimized out>)
    at /var/abs/local/eth-os/sources/KDE/kdepimlibs/akonadi/itemmodifyjob.cpp:202
#18 0x00007f3591ddcbb5 in Akonadi::JobPrivate::handleResponse (this=0x1077380, tag=..., data=...) at /var/abs/local/eth-os/sources/KDE/kdepimlibs/akonadi/job.cpp:79
#19 0x00007f3591dfd54b in Akonadi::SessionPrivate::dataReceived (this=0xbcc630) at /var/abs/local/eth-os/sources/KDE/kdepimlibs/akonadi/session.cpp:208
#20 0x00007f3591dff021 in Akonadi::Session::qt_metacall (this=0xbc5ed0, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff8e812400)
    at /var/abs/local/eth-os/sources/KDE/kdepimlibs/build/akonadi/session.moc:92
#21 0x00007f3591770f6f in QMetaObject::activate (sender=0xbcf110, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3272
#22 0x00007f35917a3f87 in QIODevice::qt_metacall (this=0xbcf110, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff8e812530) at .moc/debug-shared/moc_qiodevice.cpp:77
#23 0x00007f3590682522 in QLocalSocket::qt_metacall (this=0xbcf110, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff8e812530) at .moc/debug-shared/moc_qlocalsocket.cpp:81
#24 0x00007f3591770f6f in QMetaObject::activate (sender=0xbcf990, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3272
#25 0x00007f359067ee6f in QAbstractSocketPrivate::canReadNotification (this=0xbcb5b0) at socket/qabstractsocket.cpp:639
#26 0x00007f35906735d4 in QReadNotifier::event (this=<value optimized out>, e=<value optimized out>) at socket/qnativesocketengine.cpp:1103
#27 0x00007f3590aa5546 in QApplicationPrivate::notify_helper (this=0x9f19f0, receiver=0xa88d70, e=0x7fff8e812aa0) at kernel/qapplication.cpp:4392
#28 0x00007f3590aac393 in QApplication::notify (this=<value optimized out>, receiver=0xa88d70, e=0x7fff8e812aa0) at kernel/qapplication.cpp:4357
#29 0x00007f358eed15dc in KApplication::notify (this=0x7fff8e812da0, receiver=0xa88d70, event=0x7fff8e812aa0) at /var/abs/local/eth-os/sources/KDE/kdelibs/kdeui/kernel/kapplication.cpp:284
#30 0x00007f35917608ba in QCoreApplication::notifyInternal (this=0x7fff8e812da0, receiver=0xa88d70, event=<value optimized out>) at kernel/qcoreapplication.cpp:732
#31 0x00007f3591780375 in socketNotifierSourceDispatch (source=0x9f5630) at kernel/qeventdispatcher_glib.cpp:110
#32 0x00007f358c9aeb33 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#33 0x00007f358c9af310 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#34 0x00007f358c9af5ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#35 0x00007f35917804c8 in QEventDispatcherGlib::processEvents (this=0x9b11f0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#36 0x00007f3590b23f24 in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x00007f359175f8a3 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#38 0x00007f359175fa80 in QEventLoop::exec (this=0x7fff8e812d40, flags=...) at kernel/qeventloop.cpp:201
#39 0x00007f3591762f6e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#40 0x00007f3591dec3ad in Akonadi::ResourceBase::init (r=0xbcad90) at /var/abs/local/eth-os/sources/KDE/kdepimlibs/akonadi/resourcebase.cpp:245
#41 0x00000000004261e9 in int Akonadi::ResourceBase::init<ImapResource>(int, char**) ()
#42 0x00007f358d8eec4d in __libc_start_main () from /lib/libc.so.6
#43 0x0000000000411789 in _start ()
Comment 4 Christophe Marin 2010-09-19 14:53:36 UTC

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