Bug 117935 - crash after creating a new dimap account
Summary: crash after creating a new dimap account
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: disconnected IMAP (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 122928 130246 131957 132669 133596 134239 139421 140213 146442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-08 16:25 UTC by Mathieu Jobin
Modified: 2007-09-14 12:17 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Jobin 2005-12-08 16:25:55 UTC
Version:           unknown (using KDE 3.5.0, Gentoo)
Compiler:          gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
OS:                Linux (i686) release 2.6.12-gentoo-r6

created a new dimap account
minimized kmail
did something else
kmail crash


Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 6319)]
[KCrash handler]
#5  0xb53da0b1 in kill () from /lib/libc.so.6
#6  0xb55e61e1 in pthread_kill () from /lib/libpthread.so.0
#7  0xb55e655b in raise () from /lib/libpthread.so.0
#8  0xb53d9e44 in raise () from /lib/libc.so.6
#9  0xb53db30d in abort () from /lib/libc.so.6
#10 0xb53d3388 in __assert_fail () from /lib/libc.so.6
#11 0xb7d27865 in KMAcctCachedImap::processNewMail(bool) (this=0x863da18)
    at kmacctcachedimap.cpp:218
#12 0xb7cc9dab in KMail::AccountManager::processNextCheck(bool) (
    this=0x8375dd0, _newMail=false) at accountmanager.cpp:196
#13 0xb7cc97be in KMail::AccountManager::singleCheckMail(KMAccount*, bool) (
    this=0x8375dd0, account=0x863da18) at accountmanager.cpp:125
#14 0xb7c5be70 in KMAccount::mailCheck() (this=0x863da18) at kmaccount.cpp:380
#15 0xb7c5a2e6 in KMAccount::qt_invoke(int, QUObject*) (this=0x863da18, _id=2, 
    _o=0xbfd79a70) at kmaccount.moc:237
#16 0xb7d15cce in KMail::NetworkAccount::qt_invoke(int, QUObject*) (this=0x0, 
    _id=0, _o=0x0) at networkaccount.moc:77
#17 0xb7d1df06 in KMail::ImapAccountBase::qt_invoke(int, QUObject*) (
    this=0x863da18, _id=2, _o=0xbfd79a70) at imapaccountbase.moc:296
#18 0xb7d28e8b in KMAcctCachedImap::qt_invoke(int, QUObject*) (this=0x863da18, 
    _id=2, _o=0xbfd79a70) at kmacctcachedimap.moc:97
#19 0xb5c076ac in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8a6fd88, clist=0x8128df0, o=0xbfd79a70) at kernel/qobject.cpp:2355
#20 0xb5c07504 in QObject::activate_signal(int) (this=0x8a6fd88, signal=2)
    at kernel/qobject.cpp:2324
#21 0xb5fecc64 in QTimer::timeout() (this=0x8a6fd88)
    at .moc/debug-shared-mt/moc_qtimer.cpp:82
#22 0xb5c3309e in QTimer::event(QEvent*) (this=0x8a6fd88, e=0xbfd79d60)
    at kernel/qtimer.cpp:219
#23 0xb5b97235 in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbfd7a0c0, receiver=0x8a6fd88, e=0xbfd79d60)
    at kernel/qapplication.cpp:2635
#24 0xb5b96478 in QApplication::notify(QObject*, QEvent*) (this=0xbfd7a0c0, 
    receiver=0x8a6fd88, e=0xbfd79d60) at kernel/qapplication.cpp:2358
#25 0xb6405e88 in KApplication::notify(QObject*, QEvent*) (this=0xbfd7a0c0, 
    receiver=0x8a6fd88, event=0xbfd79d60) at kapplication.cpp:550
#26 0xb7733e16 in QApplication::sendEvent(QObject*, QEvent*) (receiver=0x0, 
    event=0x6) at qapplication.h:491
#27 0xb5b8275f in QEventLoop::activateTimers() (this=0x8130628)
    at kernel/qeventloop_unix.cpp:556
#28 0xb5b32d5d in QEventLoop::processEvents(unsigned) (this=0x8130628, flags=4)
    at kernel/qeventloop_x11.cpp:389
#29 0xb5bae7d9 in QEventLoop::enterLoop() (this=0x8130628)
    at kernel/qeventloop.cpp:198
#30 0xb5bae6f2 in QEventLoop::exec() (this=0x8130628)
    at kernel/qeventloop.cpp:145
#31 0xb5b973d7 in QApplication::exec() (this=0xbfd7a0c0)
    at kernel/qapplication.cpp:2758
#32 0x0804aa78 in main (argc=0, argv=0x0) at main.cpp:110
Comment 1 Thiago Macieira 2006-03-03 19:39:45 UTC
*** Bug 122928 has been marked as a duplicate of this bug. ***
Comment 2 Andreas Kling 2006-07-31 23:24:07 UTC

*** This bug has been marked as a duplicate of 113329 ***
Comment 3 Tommi Tervo 2006-09-06 10:10:58 UTC
*** Bug 133596 has been marked as a duplicate of this bug. ***
Comment 4 Tommi Tervo 2006-09-06 10:56:12 UTC
Not a dupe of #133329.
Comment 5 Tommi Tervo 2006-09-06 10:59:30 UTC
*** Bug 130246 has been marked as a duplicate of this bug. ***
Comment 6 Tommi Tervo 2006-09-06 11:01:11 UTC
*** Bug 131957 has been marked as a duplicate of this bug. ***
Comment 7 Tommi Tervo 2006-09-06 11:01:57 UTC
*** Bug 132669 has been marked as a duplicate of this bug. ***
Comment 8 Philip Rodrigues 2006-09-18 11:07:39 UTC
*** Bug 134239 has been marked as a duplicate of this bug. ***
Comment 9 BJ Blanchard 2006-10-23 15:43:29 UTC
I had one user experience this crash twice within first half hour of using new DIMAP account.. once when kmail was in background, and once when composing a new mail.  Backtraces are below.

Kmail version 1.9.4 (gentoo).

BJ.

Using host libthread_db library "/lib/tls/libthread_db.so.1".
Core was generated by `kontact'.
Program terminated with signal 11, Segmentation fault.
#0  KMAcctCachedImap::processNewMail (this=0x8d9c230, folder=0x0, recurse=true)
    at qvaluelist.h:233
        it = {node = 0x84049b8}
        nsToList = {<QValueList<QString>> = {sh = 0x8d97d10}, <No data fields>}
        otherNSToCheck = {<QValueList<QString>> = {
    sh = 0x85a1108}, <No data fields>}
#1  0xb64c3751 in KMAcctCachedImap::processNewMail (this=0x8d9c230)
    at kmfolder.h:130
No locals.
#2  0xb64593b5 in KMail::AccountManager::processNextCheck (this=0x84d74c0,
    _newMail=false) at accountmanager.cpp:197
        tmp = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x806d070, static shared_null = 0x806d070}, d = 0x8df8af8,
  static shared_null = 0x806d070}
#3  0xb64595a0 in KMail::AccountManager::singleCheckMail (this=0x84d74c0,
    account=0x8d9c230, interactive=false) at accountmanager.cpp:125
No locals.
#4  0xb63e0c1a in KMAccount::mailCheck (this=0x8d9c230) at kmkernel.h:223
No locals.
#5  0xb63dfe62 in KMAccount::qt_invoke (this=0x8d9c230, _id=2, _o=0xbf81aae0)
    at kmaccount.moc:237
No locals.
#6  0xb64acee9 in KMail::NetworkAccount::qt_invoke (this=0x84049b8,
    _id=138430904, _o=0x84049b8) at networkaccount.moc:77
No locals.
#7  0xb64b94e3 in KMail::ImapAccountBase::qt_invoke (this=0x8d9c230, _id=2,
    _o=0xbf81aae0) at imapaccountbase.moc:296
No locals.
#8  0xb64c1a13 in KMAcctCachedImap::qt_invoke (this=0x8d9c230, _id=2,
    _o=0xbf81aae0) at kmacctcachedimap.moc:97
No locals.
#9  0x4a4a218a in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#10 0x4a4a28b4 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#11 0x4a7e7da7 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#12 0x4a4c2ccb in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#13 0x4a43ffd4 in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#14 0x4a440167 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#15 0xb6db6332 in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
No symbol table info available.
#16 0xbf81b100 in ?? ()
No symbol table info available.
#17 0x08d9c500 in ?? ()
No symbol table info available.
#18 0xbf81ae90 in ?? ()
No symbol table info available.
#19 0xb6f3dd50 in ?? () from /usr/kde/3.5/lib/libkdecore.so.4
No symbol table info available.
#20 0x4a8f5de0 in vtable for QEvent () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#21 0x0000000b in ?? ()
No symbol table info available.
#22 0x00000048 in ?? ()
No symbol table info available.
#23 0xb6ded3ea in KSelectionWatcher::filterEvent ()
   from /usr/kde/3.5/lib/libkdecore.so.4
No symbol table info available.
#24 0x4a903288 in vtable for QPtrCollection () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#25 0x0842f720 in ?? ()
No symbol table info available.
#26 0xbf81b000 in ?? ()
No symbol table info available.
#27 0x00000010 in ?? ()
No symbol table info available.
#28 0x49d15ff4 in ?? () from /lib/tls/libc.so.6
No symbol table info available.
#29 0x49d17840 in __malloc_initialize_hook () from /lib/tls/libc.so.6
No symbol table info available.
#30 0x085bfad8 in ?? ()
No symbol table info available.
#31 0xbf81b100 in ?? ()
No symbol table info available.
#32 0x49c67b73 in malloc () from /lib/tls/libc.so.6
No symbol table info available.

and again...

#0  KMAcctCachedImap::processNewMail (this=0x9144808, folder=0x0, recurse=true)
    at qvaluelist.h:233
        it = {node = 0x91537f8}
        nsToList = {<QValueList<QString>> = {sh = 0x9971eb8}, <No data fields>}
        otherNSToCheck = {<QValueList<QString>> = {
    sh = 0x9248708}, <No data fields>}
#1  0xb657c751 in KMAcctCachedImap::processNewMail (this=0x9144808)
    at kmfolder.h:130
No locals.
#2  0xb65123b5 in KMail::AccountManager::processNextCheck (this=0x84d8cc0,
    _newMail=false) at accountmanager.cpp:197
        tmp = {static null = {
    static null = <same as static member of an already seen type>,
    d = 0x806d070, static shared_null = 0x806d070}, d = 0x876fe60,
  static shared_null = 0x806d070}
#3  0xb65125a0 in KMail::AccountManager::singleCheckMail (this=0x84d8cc0,
    account=0x9144808, interactive=false) at accountmanager.cpp:125
No locals.
#4  0xb6499c1a in KMAccount::mailCheck (this=0x9144808) at kmkernel.h:223
No locals.
#5  0xb6498e62 in KMAccount::qt_invoke (this=0x9144808, _id=2, _o=0xbfad4870)
    at kmaccount.moc:237
No locals.
#6  0xb6565ee9 in KMail::NetworkAccount::qt_invoke (this=0x91537f8,
    _id=152385528, _o=0x91537f8) at networkaccount.moc:77
No locals.
#7  0xb65724e3 in KMail::ImapAccountBase::qt_invoke (this=0x9144808, _id=2,
    _o=0xbfad4870) at imapaccountbase.moc:296
No locals.
#8  0xb657aa13 in KMAcctCachedImap::qt_invoke (this=0x9144808, _id=2,
    _o=0xbfad4870) at kmacctcachedimap.moc:97
No locals.
#9  0x4a4a218a in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#10 0x4a4a28b4 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#11 0x4a7e7da7 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#12 0x4a4c2ccb in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#13 0x4a43ffd4 in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#14 0x4a440167 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#15 0xb6e6f332 in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
No symbol table info available.
#16 0xbfad4e90 in ?? ()
No symbol table info available.
#17 0x09144ad8 in ?? ()
No symbol table info available.
#18 0xbfad4c20 in ?? ()
No symbol table info available.
#19 0x4a4d25b4 in QWidget::createTLExtra () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.

Comment 10 Allen Winter 2006-10-23 15:46:14 UTC
BJ,

Any chance you could test the newest kmail from the 3.5 branch?
Comment 11 BJ Blanchard 2006-10-23 17:50:43 UTC
And again - this time I just sent an email, and then pressed F5 from the inbox folder to force a check of mail.

BJ.

[KCrash handler]
#9  KMAcctCachedImap::processNewMail (this=0x911f910, folder=0x0, 
    recurse=true) at qvaluelist.h:233
#10 0xb65a832b in KMAcctCachedImap::processNewMail (this=0x911f910)
    at kmfolder.h:130
#11 0xb653cc51 in KMail::AccountManager::processNextCheck (this=0x84f6c48, 
    _newMail=false) at accountmanager.cpp:197
#12 0xb653ce3c in KMail::AccountManager::singleCheckMail (this=0x84f6c48, 
    account=0x911f910, interactive=false) at accountmanager.cpp:125
#13 0xb64c3cd6 in KMAccount::mailCheck (this=0x911f910) at kmaccount.cpp:384
#14 0xb64c2f16 in KMAccount::qt_invoke (this=0x911f910, _id=2, _o=0xbf89b6e0)
    at kmaccount.moc:237
#15 0xb6590d1b in KMail::NetworkAccount::qt_invoke (this=0x8af8238, 
    _id=145719864, _o=0x8af8238) at networkaccount.moc:77
#16 0xb659dd6b in KMail::ImapAccountBase::qt_invoke (this=0x911f910, _id=2, 
    _o=0xbf89b6e0) at imapaccountbase.moc:296
#17 0xb65a6495 in KMAcctCachedImap::qt_invoke (this=0x911f910, _id=2, 
    _o=0xbf89b6e0) at kmacctcachedimap.moc:97
#18 0x4a4a218a in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#19 0x4a4a28b4 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#20 0x4a7e7da7 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#21 0x4a4c2ccb in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#22 0x4a43ffd4 in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
#23 0x4a440167 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#24 0xb6e39be4 in KApplication::notify (this=0xbf89bd20, receiver=0x8d27d28, 
    event=0xbf89bab0) at kapplication.cpp:550
#25 0x4a433de9 in QEventLoop::activateTimers ()
   from /usr/qt/3/lib/libqt-mt.so.3
#26 0x4a3ed126 in QEventLoop::processEvents ()
   from /usr/qt/3/lib/libqt-mt.so.3
#27 0x4a455f82 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#28 0x4a455eda in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3
#29 0x4a43f2bb in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3
#30 0x08058e6c in main (argc=145719864, argv=0x8af8238) at main.cpp:161
#31 0x49c19eec in __libc_start_main () from /lib/tls/libc.so.6
#32 0x080585a1 in _start ()
Comment 12 Bram Schoenmakers 2006-12-31 03:09:17 UTC
*** Bug 139421 has been marked as a duplicate of this bug. ***
Comment 13 Bram Schoenmakers 2007-01-17 23:32:15 UTC
*** Bug 140213 has been marked as a duplicate of this bug. ***
Comment 14 Adam Porter 2007-01-18 02:56:22 UTC
Ok, so, this bug has been reported many times, originally over a year ago.  Do you think we could get a "NEW" status instead of "UNCONFIRMED"?
Comment 15 Antonio 2007-01-18 03:15:42 UTC
*** This bug has been confirmed by popular vote. ***
Comment 16 David Faure 2007-02-09 16:10:53 UTC
SVN commit 631934 by dfaure:

Found the reason why KMAcctCachedImap::processNewMail's assert below was hit
  assert( mFolder );  // George says "better to crash then lose mail"
The configuration dialog creates temporary copies of the account when modifying one;
but it doesn't delete that copy when closing with Cancel. What's more, the copied account
started its own timer for interval-mail-checking, and when that timer fired, KMAcctCachedImap
would crash due to mFolder=0. So:
1) delete things in the dtor to avoid the account memleak
2) don't start the mailcheck timer when simply setting the checkinterval of an account,
   only when the account is added to the AccountManager for real.
BUG: 117935


 M  +23 -2     configuredialog.cpp  
 M  +2 -1      configuredialog_p.h  
 M  +6 -6      kmaccount.cpp  


--- branches/KDE/3.5/kdepim/kmail/configuredialog.cpp #631933:631934
@@ -1147,7 +1147,29 @@
            this, SLOT(slotEditNotifications()) );
 }
 
+AccountsPageReceivingTab::~AccountsPageReceivingTab()
+{
+  // When hitting Cancel or closing the dialog with the window-manager-button,
+  // we have a number of things to clean up:
 
+  // The newly created accounts
+  QValueList< QGuardedPtr<KMAccount> >::Iterator it;
+  for (it = mNewAccounts.begin(); it != mNewAccounts.end(); ++it ) {
+    delete (*it);
+  }
+  mNewAccounts.clear();
+
+  // The modified accounts
+  QValueList<ModifiedAccountsType*>::Iterator j;
+  for ( j = mModifiedAccounts.begin() ; j != mModifiedAccounts.end() ; ++j ) {
+    delete (*j)->newAccount;
+    delete (*j);
+  }
+  mModifiedAccounts.clear();
+
+
+}
+
 void AccountsPage::ReceivingTab::slotAccountSelected()
 {
   QListViewItem * item = mAccountList->selectedItem();
@@ -1398,8 +1420,7 @@
   // Add accounts marked as new
   QValueList< QGuardedPtr<KMAccount> >::Iterator it;
   for (it = mNewAccounts.begin(); it != mNewAccounts.end(); ++it ) {
-    kmkernel->acctMgr()->add( *it );
-    (*it)->installTimer();
+    kmkernel->acctMgr()->add( *it ); // calls installTimer too
   }
 
   // Update accounts that have been modified
--- branches/KDE/3.5/kdepim/kmail/configuredialog_p.h #631933:631934
@@ -349,6 +349,7 @@
   Q_OBJECT
 public:
   AccountsPageReceivingTab( QWidget * parent=0, const char * name=0 );
+  ~AccountsPageReceivingTab();
   QString helpAnchor() const;
   void save();
 
@@ -384,7 +385,7 @@
     QGuardedPtr< KMAccount > oldAccount;
     QGuardedPtr< KMAccount > newAccount;
   };
-  // ### make this a qptrlist:
+  // ### make this value-based:
   QValueList< ModifiedAccountsType* >  mModifiedAccounts;
 };
 
--- branches/KDE/3.5/kdepim/kmail/kmaccount.cpp #631933:631934
@@ -151,6 +151,11 @@
   {
     setFolder(kmkernel->folderMgr()->findIdString(folderName), true);
   }
+
+  if (mInterval == 0)
+    deinstallTimer();
+  else
+    installTimer();
 }
 
 
@@ -278,15 +283,10 @@
 void KMAccount::setCheckInterval(int aInterval)
 {
   if (aInterval <= 0)
-  {
     mInterval = 0;
-    deinstallTimer();
-  }
   else
-  {
     mInterval = aInterval;
-    installTimer();
-  }
+  // Don't call installTimer from here! See #117935.
 }
 
 //----------------------------------------------------------------------------
Comment 17 Bram Schoenmakers 2007-06-06 19:13:42 UTC
*** Bug 146442 has been marked as a duplicate of this bug. ***