Bug 303952

Summary: Akonadi imap resource crashes
Product: [Frameworks and Libraries] Akonadi Reporter: Martin Bednar <martin+kde>
Component: IMAP resourceAssignee: Kevin Ottens <ervin>
Status: RESOLVED FIXED    
Severity: crash CC: faure, kdepim-bugs, vkrause
Priority: NOR    
Version: 4.8   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=302148
Latest Commit: Version Fixed In: 4.10.2

Description Martin Bednar 2012-07-23 10:48:26 UTC
Application: akonadi_imap_resource (4.8)
KDE Platform Version: 4.8.97
Qt Version: 4.8.2
Operating System: Linux 3.4.5-pf-PF x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:

Started up KDE session, with akonadi starting automatically. The imap resource encountered an error : Login failed, server replied: A000002 NO Lookup failed v18if12417105wed.180
, showed a dialog allowing changing the config or trying again or canceling. Any action taken results in this crash, every time.
Easiest way to reproduce is restarting the akonadi server. This might be due to a network configuration problem, however the resource shouldn't crash.

The crash can be reproduced every time.

-- Backtrace:
Application: GMail de type Serveur de courriels IMAP (akonadi_imap_resource), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f845afe5780 (LWP 1544))]

Thread 2 (Thread 0x7f8448d98700 (LWP 1626)):
#0  0x00007f84569388d3 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8455685496 in g_main_context_poll (n_fds=1, fds=0x15e0060, timeout=-1, context=0x16bfc30, priority=<optimized out>) at gmain.c:3440
#2  g_main_context_iterate (context=0x16bfc30, block=1, dispatch=1, self=<optimized out>) at gmain.c:3141
#3  0x00007f84556855b4 in g_main_context_iteration (context=0x16bfc30, may_block=1) at gmain.c:3207
#4  0x00007f845a406d06 in QEventDispatcherGlib::processEvents (this=0x165d540, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:426
#5  0x00007f845a3d6862 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f845a3d6b15 in QEventLoop::exec (this=0x7f8448d97de0, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f845a2d4198 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#8  0x00007f8459026389 in KIMAP::SessionThread::run (this=0x165d870) at /var/tmp/portage/kde-base/kdepimlibs-4.8.97/work/kdepimlibs-4.8.97/kimap/sessionthread.cpp:181
#9  0x00007f845a2d680b in QThreadPrivate::start (arg=0x165d870) at thread/qthread_unix.cpp:307
#10 0x00007f84561f3d0c in start_thread (arg=0x7f8448d98700) at pthread_create.c:301
#11 0x00007f845694164d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f845afe5780 (LWP 1544)):
[KCrash Handler]
#6  0x00007f845a3f1026 in QObject::connect (sender=0x15002e0, signal=0x469628 "2stateChanged(KIMAP::Session::State,KIMAP::Session::State)", receiver=0x14d96e0, method=0x4695e0 "1onSessionStateChanged(KIMAP::Session::State,KIMAP::Session::State)", type=Qt::AutoConnection) at kernel/qobject.cpp:2551
#7  0x0000000000456a66 in SessionPool::onPasswordRequestDone (this=0x14d96e0, resultType=<optimized out>, password=...) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97/resources/imap/sessionpool.cpp:335
#8  0x000000000045853f in SessionPool::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97_build/resources/imap/sessionpool.moc:94
#9  0x00007f845a3ed343 in QMetaObject::activate (sender=0x14d3700, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff7bbbffe0) at kernel/qobject.cpp:3547
#10 0x0000000000444701 in PasswordRequesterInterface::done (this=<optimized out>, _t1=0, _t2=<optimized out>) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97_build/resources/imap/passwordrequesterinterface.moc:118
#11 0x0000000000423a62 in SettingsPasswordRequester::onPasswordRequestCompleted (this=0x14d3700, password=..., userRejected=false) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97/resources/imap/settingspasswordrequester.cpp:89
#12 0x00007f845a3ed343 in QMetaObject::activate (sender=0x14d9b70, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff7bbc01a0) at kernel/qobject.cpp:3547
#13 0x0000000000422361 in Settings::passwordRequestCompleted (this=<optimized out>, _t1=<optimized out>, _t2=false) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97_build/resources/imap/settings.moc:124
#14 0x000000000042293c in Settings::onDialogFinished (this=0x14d9b70, result=<optimized out>) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97/resources/imap/settings.cpp:164
#15 0x0000000000422b53 in Settings::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97_build/resources/imap/settings.moc:74
#16 0x00007f845a3ed343 in QMetaObject::activate (sender=0x14ca780, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff7bbc03a0) at kernel/qobject.cpp:3547
#17 0x00007f8459c26dce in QDialog::finished (this=<optimized out>, _t1=1) at .moc/release-shared/moc_qdialog.cpp:153
#18 0x00007f8459c26e6a in QDialog::done (this=<optimized out>, r=1) at dialogs/qdialog.cpp:597
#19 0x00007f84577e2238 in KPasswordDialog::KPasswordDialogPrivate::actuallyAccept (this=0x17b16c0) at /var/tmp/portage/kde-base/kdelibs-4.8.97/work/kdelibs-4.8.97/kdeui/dialogs/kpassworddialog.cpp:404
#20 0x00007f845a3ec786 in QObject::event (this=0x14ca780, e=<optimized out>) at kernel/qobject.cpp:1195
#21 0x00007f84597c55ed in QWidget::event (this=0x14ca780, event=0x1fe0ec0) at kernel/qwidget.cpp:8830
#22 0x00007f8459774374 in QApplicationPrivate::notify_helper (this=0x132bc00, receiver=0x14ca780, e=0x1fe0ec0) at kernel/qapplication.cpp:4551
#23 0x00007f8459778e4f in QApplication::notify (this=<optimized out>, receiver=0x14ca780, e=0x1fe0ec0) at kernel/qapplication.cpp:4412
#24 0x00007f8457864b26 in KApplication::notify (this=0x7fff7bbc10e0, receiver=0x14ca780, event=0x1fe0ec0) at /var/tmp/portage/kde-base/kdelibs-4.8.97/work/kdelibs-4.8.97/kdeui/kernel/kapplication.cpp:311
#25 0x00007f845a3d7afb in QCoreApplication::notifyInternal (this=0x7fff7bbc10e0, receiver=0x14ca780, event=0x1fe0ec0) at kernel/qcoreapplication.cpp:915
#26 0x00007f845a3db0c7 in sendEvent (event=0x1fe0ec0, receiver=0x14ca780) at kernel/qcoreapplication.h:231
#27 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x13099b0) at kernel/qcoreapplication.cpp:1539
#28 0x00007f845a406b13 in sendPostedEvents () at kernel/qcoreapplication.h:236
#29 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:279
#30 0x00007f84556851b2 in g_main_dispatch (context=0x132d200) at gmain.c:2539
#31 g_main_context_dispatch (context=0x132d200) at gmain.c:3075
#32 0x00007f84556854f8 in g_main_context_iterate (context=0x132d200, block=1, dispatch=1, self=<optimized out>) at gmain.c:3146
#33 0x00007f84556855b4 in g_main_context_iteration (context=0x132d200, may_block=1) at gmain.c:3207
#34 0x00007f845a406caf in QEventDispatcherGlib::processEvents (this=0x1309240, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#35 0x00007f845981973e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#36 0x00007f845a3d6862 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#37 0x00007f845a3d6b15 in QEventLoop::exec (this=0x7fff7bbc1050, flags=...) at kernel/qeventloop.cpp:204
#38 0x00007f845a3db56b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#39 0x00007f845ab135a6 in Akonadi::ResourceBase::init (r=0x14aa480) at /var/tmp/portage/kde-base/kdepimlibs-4.8.97/work/kdepimlibs-4.8.97/akonadi/resourcebase.cpp:450
#40 0x000000000041a2b8 in init<ImapResource> (argv=<optimized out>, argc=<optimized out>) at /usr/include/akonadi/resourcebase.h:188
#41 main (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/kde-base/kdepim-runtime-4.8.97/work/kdepim-runtime-4.8.97/resources/imap/imapresource.cpp:652

This bug may be a duplicate of or related to bug 302148.

Possible duplicates by query: bug 302148, bug 300613, bug 299281, bug 298326, bug 297850.

Reported using DrKonqi
Comment 1 David Faure 2013-03-03 13:04:45 UTC
commit 5c4a1fea0347e7536ec2c03aebb421536daba441
Author: David Faure <faure@kde.org>
Date:   Sat Mar 2 14:59:19 2013 +0100

    Fix crash in SessionPool::onPasswordRequestDone, again due to m_pendingInitialSession.
    
    It could become dangling in the following case:
    - wrong imap password, error dialog shows up, leave it up
    - wait for connection to drop (idle timeout, or maybe due to losing network altogether)
    - resource reconnects, wrong password still, error dialog show up.
    When closing them both, the 2nd one ends up in SessionPool::onPasswordRequestDone with
    a dangling m_pendingInitialSession.