Bug 312435

Summary: Kmail2 crashed when creating a toplevel folder on a gmail imap account
Product: kmail2 Reporter: Luis Silva <lacsilva>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: amantia
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2

Description Luis Silva 2012-12-31 15:52:20 UTC
Application: kmail (4.11 pre)
KDE Platform Version: 4.9.95 (Compiled from sources)
Qt Version: 4.8.3
Operating System: Linux 3.7.0-7-generic i686
Distribution: Ubuntu Raring Ringtail (development branch)

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

I was trying to create a toplevel folder on my disconnected gmail imap account.  I selected "Add Folder" from the context menu. The application crashed when I clicked OK on the new folder name dialog. The folder, however, was created on the server (confirmed through the webmail interface) and is visible in akonadiconsole but is not shown in kmail.

-- Backtrace:
Application: KMail (kmail), signal: Segmentation fault
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xb18b0740 (LWP 19099))]

Thread 6 (Thread 0xaebcbb40 (LWP 19103)):
#0  0xb7776424 in __kernel_vsyscall ()
#1  0xb58d7975 in __pthread_cond_wait (cond=0xb4137470, mutex=0xb4137458) at pthread_cond_wait.c:155
#2  0xb5f2356c in __pthread_cond_wait (cond=0xb4137470, mutex=0xb4137458) at forward.c:149
#3  0xb39e00e9 in ?? () from /usr/lib/i386-linux-gnu/libQtWebKit.so.4
#4  0xb39e01df in ?? () from /usr/lib/i386-linux-gnu/libQtWebKit.so.4
#5  0xb58d3d78 in start_thread (arg=0xaebcbb40) at pthread_create.c:311
#6  0xb5f15bbe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:132

Thread 5 (Thread 0xae2a2b40 (LWP 19104)):
#0  0xb4589e3d in __GI_clock_gettime (clock_id=1, tp=0xae2a1fa8) at ../sysdeps/unix/clock_gettime.c:115
#1  0xb61a1fb5 in do_gettime (frac=0xae2a1fa0, sec=0xae2a1f98) at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0xb628936e in QTimerInfoList::updateCurrentTime (this=0xad902074) at kernel/qeventdispatcher_unix.cpp:343
#4  0x7fffffff in ?? ()
#5  0xb62896fa in QTimerInfoList::timerWait (this=0xad902074, tm=...) at kernel/qeventdispatcher_unix.cpp:450
#6  0x7fffffff in ?? ()

Thread 4 (Thread 0xad877b40 (LWP 19105)):
#0  0xb7776424 in __kernel_vsyscall ()
#1  0xb5f076bb in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb47207cb in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb4711d40 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb4711ea1 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb628899f in QEventDispatcherGlib::processEvents (this=0xacf00468, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0xb625526c in QEventLoop::processEvents (this=this@entry=0xad877228, flags=...) at kernel/qeventloop.cpp:149
#7  0xb6255561 in QEventLoop::exec (this=0xad877228, flags=...) at kernel/qeventloop.cpp:204
#8  0xb614066c in QThread::exec (this=0x930e3d0) at thread/qthread.cpp:501
#9  0xb62337bd in QInotifyFileSystemWatcherEngine::run (this=0x930e3d0) at io/qfilesystemwatcher_inotify.cpp:248
#10 0xb6143a58 in QThreadPrivate::start (arg=0x930e3d0) at thread/qthread_unix.cpp:338
#11 0xb58d3d78 in start_thread (arg=0xad877b40) at pthread_create.c:311
#12 0xb5f15bbe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:132

Thread 3 (Thread 0xacaefb40 (LWP 19113)):
#0  0xb7776424 in __kernel_vsyscall ()
#1  0xb58d7c13 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:237
#2  0xb5f235c4 in __pthread_cond_timedwait (cond=0x9385ec0, mutex=0x9385ea8, abstime=0xacaef228) at forward.c:162
#3  0xb6143fad in wait (time=30000, this=0x9385ea8) at thread/qwaitcondition_unix.cpp:84
#4  QWaitCondition::wait (this=0x9385d08, mutex=0x9385d04, time=30000) at thread/qwaitcondition_unix.cpp:158
#5  0xb613654c in QThreadPoolThread::run (this=0x938cea8) at concurrent/qthreadpool.cpp:141
#6  0xb6143a58 in QThreadPrivate::start (arg=0x938cea8) at thread/qthread_unix.cpp:338
#7  0xb58d3d78 in start_thread (arg=0xacaefb40) at pthread_create.c:311
#8  0xb5f15bbe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:132

Thread 2 (Thread 0xabd3ab40 (LWP 19139)):
#0  0xb7776424 in __kernel_vsyscall ()
#1  0xb58d7c13 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:237
#2  0xb5f235c4 in __pthread_cond_timedwait (cond=0x9bc2eb0, mutex=0x9bc2e98, abstime=0xabd3a228) at forward.c:162
#3  0xb6143fad in wait (time=30000, this=0x9bc2e98) at thread/qwaitcondition_unix.cpp:84
#4  QWaitCondition::wait (this=0x9bc2e68, mutex=0x9bc2e64, time=30000) at thread/qwaitcondition_unix.cpp:158
#5  0xb613654c in QThreadPoolThread::run (this=0x96bb278) at concurrent/qthreadpool.cpp:141
#6  0xb6143a58 in QThreadPrivate::start (arg=0x96bb278) at thread/qthread_unix.cpp:338
#7  0xb58d3d78 in start_thread (arg=0xabd3ab40) at pthread_create.c:311
#8  0xb5f15bbe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:132

Thread 1 (Thread 0xb18b0740 (LWP 19099)):
[KCrash Handler]
#7  QSortFilterProxyModelPrivate::updateChildrenMapping (this=0x9eb8ab8, source_parent=..., parent_mapping=0xa379408, orient=Qt::Vertical, start=0, end=0, delta_item_count=1, remove=false) at itemviews/qsortfilterproxymodel.cpp:948
#8  0xb6b26c44 in QSortFilterProxyModelPrivate::source_items_inserted (this=this@entry=0x9eb8ab8, source_parent=..., start=start@entry=0, end=end@entry=0, orient=orient@entry=Qt::Vertical) at itemviews/qsortfilterproxymodel.cpp:745
#9  0xb6b27230 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted (this=0x9eb8ab8, source_parent=..., start=0, end=0) at itemviews/qsortfilterproxymodel.cpp:1281
#10 0xb625f60d in QMetaMethod::invoke (this=0xbfc059b4, object=0x9eb8718, connectionType=Qt::DirectConnection, returnValue=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1664
#11 0xb6261c89 in QMetaObject::invokeMethod (obj=0x9eb8718, member=0xb7685ea0 "_q_sourceRowsInserted", type=Qt::DirectConnection, ret=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1179
#12 0xb74b1387 in invokeMethod (val9=..., val8=..., val7=..., val6=..., val5=..., val4=..., val3=..., val2=..., val1=..., val0=..., type=Qt::DirectConnection, member=0xb7685ea0 "_q_sourceRowsInserted", obj=0x9eb8718) at /usr/include/qt4/QtCore/qobjectdefs.h:418
#13 invokeRowsInserted (end=0, start=0, source_parent=..., this=0x9eb8d50) at ../../kdeui/itemviews/krecursivefilterproxymodel.cpp:66
#14 KRecursiveFilterProxyModelPrivate::sourceRowsInserted (this=0x9eb8d50, source_parent=..., start=0, end=0) at ../../kdeui/itemviews/krecursivefilterproxymodel.cpp:190
#15 0xb626eed6 in QMetaObject::activate (sender=0x9eb8418, m=0xb63bb298 <QAbstractItemModel::staticMetaObject>, local_signal_index=5, argv=0xbfc05d90) at kernel/qobject.cpp:3547
#16 0xb62be7f5 in QAbstractItemModel::rowsInserted (this=0x9eb8418, _t1=..., _t2=0, _t3=0) at .moc/release-shared/moc_qabstractitemmodel.cpp:197
#17 0xb62508a3 in QAbstractItemModel::endInsertRows (this=0x9eb8418) at kernel/qabstractitemmodel.cpp:2433
#18 0xb74afced in _k_sourceRowsInserted (end=<optimized out>, start=<optimized out>, parent=..., this=<optimized out>) at ../../kdeui/itemviews/kidentityproxymodel.cpp:724
#19 qt_static_metacall (_a=0xbfc05f00, _id=2, _o=0x9eb8418, _c=<optimized out>) at ./kidentityproxymodel.moc:90
#20 KIdentityProxyModel::qt_static_metacall (_o=0x9eb8418, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xbfc05f00) at ./kidentityproxymodel.moc:82
#21 0xb626eed6 in QMetaObject::activate (sender=0x9eada70, m=0xb63bb298 <QAbstractItemModel::staticMetaObject>, local_signal_index=5, argv=0xbfc05f00) at kernel/qobject.cpp:3547
#22 0xb62be7f5 in QAbstractItemModel::rowsInserted (this=0x9eada70, _t1=..., _t2=0, _t3=0) at .moc/release-shared/moc_qabstractitemmodel.cpp:197
#23 0xb62508a3 in QAbstractItemModel::endInsertRows (this=0x9eada70) at kernel/qabstractitemmodel.cpp:2433
#24 0xb74afced in _k_sourceRowsInserted (end=<optimized out>, start=<optimized out>, parent=..., this=<optimized out>) at ../../kdeui/itemviews/kidentityproxymodel.cpp:724
#25 qt_static_metacall (_a=0xbfc06070, _id=2, _o=0x9eada70, _c=<optimized out>) at ./kidentityproxymodel.moc:90
#26 KIdentityProxyModel::qt_static_metacall (_o=0x9eada70, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xbfc06070) at ./kidentityproxymodel.moc:82
#27 0xb626eed6 in QMetaObject::activate (sender=0x8ea15b8, m=0xb63bb298 <QAbstractItemModel::staticMetaObject>, local_signal_index=5, argv=0xbfc06070) at kernel/qobject.cpp:3547
#28 0xb62be7f5 in QAbstractItemModel::rowsInserted (this=0x8ea15b8, _t1=..., _t2=0, _t3=0) at .moc/release-shared/moc_qabstractitemmodel.cpp:197
#29 0xb62508a3 in QAbstractItemModel::endInsertRows (this=0x8ea15b8) at kernel/qabstractitemmodel.cpp:2433
#30 0xb6b23034 in QSortFilterProxyModelPrivate::insert_source_items (this=0x8fb0550, source_to_proxy=..., proxy_to_source=..., source_items=..., source_parent=..., orient=Qt::Vertical, emit_signal=true) at itemviews/qsortfilterproxymodel.cpp:695
#31 0xb6b26dfc in QSortFilterProxyModelPrivate::source_items_inserted (this=this@entry=0x8fb0550, source_parent=..., start=start@entry=0, end=end@entry=0, orient=orient@entry=Qt::Vertical) at itemviews/qsortfilterproxymodel.cpp:806
#32 0xb6b27230 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted (this=0x8fb0550, source_parent=..., start=0, end=0) at itemviews/qsortfilterproxymodel.cpp:1281
#33 0xb626eed6 in QMetaObject::activate (sender=0x8f41d78, m=0xb63bb298 <QAbstractItemModel::staticMetaObject>, local_signal_index=5, argv=0xbfc062f0) at kernel/qobject.cpp:3547
#34 0xb62be7f5 in QAbstractItemModel::rowsInserted (this=0x8f41d78, _t1=..., _t2=0, _t3=0) at .moc/release-shared/moc_qabstractitemmodel.cpp:197
#35 0xb62508a3 in QAbstractItemModel::endInsertRows (this=0x8f41d78) at kernel/qabstractitemmodel.cpp:2433
#36 0xb54708d3 in Akonadi::EntityTreeModelPrivate::insertCollection(Akonadi::Collection const&, Akonadi::Collection const&) () from /usr/lib/libakonadi-kde.so.4
#37 0xb5473e53 in Akonadi::EntityTreeModelPrivate::monitoredCollectionAdded(Akonadi::Collection const&, Akonadi::Collection const&) () from /usr/lib/libakonadi-kde.so.4
#38 0xb546a24a in Akonadi::EntityTreeModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libakonadi-kde.so.4
#39 0xb626eed6 in QMetaObject::activate (sender=0x8e8b2f0, m=0xb556f9b8 <Akonadi::Monitor::staticMetaObject>, local_signal_index=6, argv=0xbfc06524) at kernel/qobject.cpp:3547
#40 0xb54999df in Akonadi::Monitor::collectionAdded(Akonadi::Collection const&, Akonadi::Collection const&) () from /usr/lib/libakonadi-kde.so.4
#41 0xb549cd3a in Akonadi::MonitorPrivate::emitCollectionNotification(Akonadi::NotificationMessage const&, Akonadi::Collection const&, Akonadi::Collection const&, Akonadi::Collection const&) () from /usr/lib/libakonadi-kde.so.4
#42 0xb549d49e in Akonadi::MonitorPrivate::emitNotification(Akonadi::NotificationMessage const&) () from /usr/lib/libakonadi-kde.so.4
#43 0xb543cb54 in Akonadi::ChangeRecorderPrivate::emitNotification(Akonadi::NotificationMessage const&) () from /usr/lib/libakonadi-kde.so.4
#44 0xb549d26c in Akonadi::MonitorPrivate::flushPipeline() () from /usr/lib/libakonadi-kde.so.4
#45 0xb549d2c6 in Akonadi::MonitorPrivate::dataAvailable() () from /usr/lib/libakonadi-kde.so.4
#46 0xb5499f43 in Akonadi::Monitor::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libakonadi-kde.so.4
#47 0xb626eed6 in QMetaObject::activate (sender=0x8facdb0, m=0xb556ea7c <Akonadi::EntityCacheBase::staticMetaObject>, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3547
#48 0xb546499d in Akonadi::EntityCacheBase::dataAvailable() () from /usr/lib/libakonadi-kde.so.4
#49 0xb5441035 in Akonadi::EntityCache<Akonadi::Collection, Akonadi::CollectionFetchJob, Akonadi::CollectionFetchScope>::processResult(KJob*) () from /usr/lib/libakonadi-kde.so.4
#50 0xb54649da in Akonadi::EntityCacheBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libakonadi-kde.so.4
#51 0xb626eed6 in QMetaObject::activate (sender=0x9baa968, m=0xb730d48c <KJob::staticMetaObject>, local_signal_index=3, argv=0xbfc06928) at kernel/qobject.cpp:3547
#52 0xb7155d65 in KJob::result (this=this@entry=0x9baa968, _t1=_t1@entry=0x9baa968) at ./kjob.moc:208
#53 0xb7155db8 in KJob::emitResult (this=0x9baa968) at ../../kdecore/jobs/kjob.cpp:318
#54 0xb5496d37 in Akonadi::JobPrivate::delayedEmitResult() () from /usr/lib/libakonadi-kde.so.4
#55 0xb62689aa in QMetaCallEvent::placeMetaCall (this=0x98e6a90, object=0x9baa968) at kernel/qobject.cpp:525
#56 0xb626ceeb in QObject::event (this=0x9baa968, e=0x98e6a90) at kernel/qobject.cpp:1195
#57 0xb64f939c in QApplicationPrivate::notify_helper (this=0x8d61510, receiver=0x9baa968, e=0x98e6a90) at kernel/qapplication.cpp:4562
#58 0xb64fddaf in QApplication::notify (this=0x98e6a90, receiver=0x9baa968, e=0x98e6a90) at kernel/qapplication.cpp:3944
#59 0xb74f4501 in KApplication::notify (this=0xbfc071e4, receiver=0x9baa968, event=0x98e6a90) at ../../kdeui/kernel/kapplication.cpp:311
#60 0xb625678e in QCoreApplication::notifyInternal (this=0xbfc071e4, receiver=0x9baa968, event=0x98e6a90) at kernel/qcoreapplication.cpp:915
#61 0xb625a97d in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#62 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x8ce5150) at kernel/qcoreapplication.cpp:1539
#63 0xb625ac0c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1432
#64 0xb6288804 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#65 postEventSourceDispatch (s=0x8d59790) at kernel/qeventdispatcher_glib.cpp:279
#66 0xb4711a23 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#67 0xb4711dc0 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#68 0xb4711ea1 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#69 0xb6288981 in QEventDispatcherGlib::processEvents (this=0x8ce5ed8, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#70 0xb65af9aa in QGuiEventDispatcherGlib::processEvents (this=0x8ce5ed8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#71 0xb625526c in QEventLoop::processEvents (this=this@entry=0xbfc070b8, flags=...) at kernel/qeventloop.cpp:149
#72 0xb6255561 in QEventLoop::exec (this=0xbfc070b8, flags=...) at kernel/qeventloop.cpp:204
#73 0xb625acba in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#74 0xb64f6fc4 in QApplication::exec () at kernel/qapplication.cpp:3823
#75 0x0804ab69 in main ()

Possible duplicates by query: bug 310025, bug 289310, bug 277822, bug 276643.

Reported using DrKonqi
Comment 1 András Manţia 2013-03-28 21:45:47 UTC
Git commit d8fd7a28e7d6d8a89dd398311d423118ff529718 by Andras Mantia.
Committed on 28/03/2013 at 22:45.
Pushed by amantia into branch 'KDE/4.10'.

1) Fix creation of new toplevel folders (and all its subfolder): it used to generate a broken remote id and separtor ("i") causing weird problems.
2) Make sure toplevel imap folders are shown immediately, without a need to sync the account (workarounds an ETM bug 291143)
3) Warn the user if creating a folder failed on server-side and remove the folder locally. Otherwise if creation failed, it was impossible to create again a folder with the same name,
as it was already a folder with that name in the akonadi cache...
4) Make sure deleting folder "foo" doesn't deleted all folders starting with "foo" as it did before.
5) Just fix folder deletion. :) It could fail in certain cases.
6) Fix and adapt the tests.

Reporters of closed bugs: if you can still see the bug in 4.10.2, please reopen and state the details.

REVIEW: 109276
FIXED-IN: 4.10.2291143291143
Related: bug 305269, bug 301088, bug 292418, bug 305987, bug 291143

M  +6    -1    resources/imap/addcollectiontask.cpp
M  +1    -1    resources/imap/changecollectiontask.cpp
M  +16   -0    resources/imap/imapresource.cpp
M  +7    -0    resources/imap/imapresource.h
M  +11   -8    resources/imap/removecollectionrecursivetask.cpp
M  +1    -0    resources/imap/removecollectionrecursivetask.h
M  +10   -0    resources/imap/resourcetask.cpp
M  +2    -0    resources/imap/resourcetask.h
M  +4    -1    resources/imap/tests/dummyresourcestate.cpp
M  +7    -5    resources/imap/tests/testremovecollectiontask.cpp

http://commits.kde.org/kdepim-runtime/d8fd7a28e7d6d8a89dd398311d423118ff529718