Bug 133023

Summary: Kmail crashing when opening an IMAP folder
Product: [Applications] kmail Reporter: Michael Zaugg <dev.miguel>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 1.9.4   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Michael Zaugg 2006-08-26 14:31:12 UTC
Version:           1.9.4 (using KDE 3.5.4 Level "a" , unofficial build of SUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.21-0.13-default

When i try to open an imap folder Kmail crashes since this version. Kmail crashes only with one of multiple IMAP Accounts and only if I try to expand the collapsed account folder. If the folder is already expanded kmail does not crash. I can reproduce this by collapsing the account and then expanding.

Here is the backtrace
=========================
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1240799568 (LWP 8891)]
[New Thread -1283531872 (LWP 8906)]
[New Thread -1275139168 (LWP 8905)]
[New Thread -1266746464 (LWP 8904)]
[New Thread -1258353760 (LWP 8903)]
[KCrash handler]
#6  0xb7edd7d7 in QMapPrivate<KPIM::ProgressItem*, bool>::QMapPrivate ()
   from /opt/kde3/lib/libkdepim.so.1
#7  0xb7edda1e in QMap<KPIM::ProgressItem*, bool>::detachInternal ()
   from /opt/kde3/lib/libkdepim.so.1
#8  0xb7eddcec in QMap<KPIM::ProgressItem*, bool>::remove ()
   from /opt/kde3/lib/libkdepim.so.1
#9  0xb7edbcbc in KPIM::ProgressItem::removeChild ()
   from /opt/kde3/lib/libkdepim.so.1
#10 0xb7edbe79 in KPIM::ProgressItem::setComplete ()
   from /opt/kde3/lib/libkdepim.so.1
#11 0xb54a878b in KMail::ImapAccountBase::removeJob ()
   from /opt/kde3/lib/libkmailprivate.so
#12 0xb53e8fde in KMail::ListJob::slotListResult ()
   from /opt/kde3/lib/libkmailprivate.so
#13 0xb53e96da in KMail::ListJob::qt_invoke ()
   from /opt/kde3/lib/libkmailprivate.so
#14 0xb6cb2edd in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#15 0xb779870e in KIO::Job::result () from /opt/kde3/lib/libkio.so.4
#16 0xb77e189d in KIO::Job::emitResult () from /opt/kde3/lib/libkio.so.4
#17 0xb77ef51e in KIO::SimpleJob::slotFinished ()
   from /opt/kde3/lib/libkio.so.4
#18 0xb77ef8ad in KIO::ListJob::slotFinished () from /opt/kde3/lib/libkio.so.4
#19 0xb780449e in KIO::ListJob::qt_invoke () from /opt/kde3/lib/libkio.so.4
#20 0xb6cb2edd in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#21 0xb6cb3b3d in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#22 0xb77944bc in KIO::SlaveInterface::finished ()
   from /opt/kde3/lib/libkio.so.4
#23 0xb77edec5 in KIO::SlaveInterface::dispatch ()
   from /opt/kde3/lib/libkio.so.4
#24 0xb7801c4a in KIO::SlaveInterface::dispatch ()
   from /opt/kde3/lib/libkio.so.4
#25 0xb77a896c in KIO::Slave::gotInput () from /opt/kde3/lib/libkio.so.4
#26 0xb77e6d30 in KIO::Slave::qt_invoke () from /opt/kde3/lib/libkio.so.4
#27 0xb6cb2edd in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#28 0xb6cb3a42 in QObject::activate_signal ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#29 0xb6fec870 in QSocketNotifier::activated ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#30 0xb6cd10e0 in QSocketNotifier::event () from /usr/lib/qt3/lib/libqt-mt.so.3
#31 0xb6c53ec7 in QApplication::internalNotify ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#32 0xb6c54c91 in QApplication::notify () from /usr/lib/qt3/lib/libqt-mt.so.3
#33 0xb730f963 in KApplication::notify () from /opt/kde3/lib/libkdecore.so.4
#34 0xb6c48b04 in QEventLoop::activateSocketNotifiers ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#35 0xb6c037d4 in QEventLoop::processEvents ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#36 0xb6c6ace8 in QEventLoop::enterLoop () from /usr/lib/qt3/lib/libqt-mt.so.3
#37 0xb6c6ab7e in QEventLoop::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
#38 0xb6c53a7f in QApplication::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
#39 0x08058c02 in main ()
Comment 1 Andreas Kling 2006-09-17 19:50:46 UTC
SVN commit 585670 by kling:

Use a QGuardedPtr for the KPIM::ProgressItem in KMAccount.
Fixes a bazillion crashes when dereferencing deleted items.

BUG: 105701
BUG: 114953
BUG: 114197
BUG: 117475
BUG: 118083
BUG: 128131
BUG: 129007
BUG: 133023
BUG: 133745


 M  +1 -1      kmaccount.h  


--- branches/KDE/3.5/kdepim/kmail/kmaccount.h #585669:585670
@@ -309,7 +309,7 @@
   QValueList<KMMessage*> mReceipts;
   QPtrList<FolderJob>  mJobList;
   bool mHasInbox : 1;
-  ProgressItem *mMailCheckProgressItem;
+  QGuardedPtr<ProgressItem> mMailCheckProgressItem;
 
 private:
     /**