Bug 119112 - Kontact (kmail) crash possibly due to KWallet password wierdness
Summary: Kontact (kmail) crash possibly due to KWallet password wierdness
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.9
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-28 12:37 UTC by Henk Poley
Modified: 2007-09-14 12:17 UTC (History)
0 users

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 Henk Poley 2005-12-28 12:37:18 UTC
Version:           1.9 (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.14-suspend2-r1

Last KDE start KDED entered a loop so I had to kill -9 it. This might be related to this crash. Kontact didn't seem to remember that KWallet contained my mail password, so it asked for it. So I opened the configuration panel for Kontact to add the password to KWallet again. After getting at least some mails Kontact crashed.

Backtrace:

Using host libthread_db library "/lib/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1224747344 (LWP 19502)]
[KCrash handler]
#4  QObject::receivers (this=0x8c852a8, signal=6) at qptrvector.h:62
#5  0x4d8e0044 in KPIM::ProgressItem::progressItemStatus (this=0x8c852a8, 
    t0=0x8c852a8, t1=@0x8c852a8) at qmetaobject.h:261
#6  0x4d8df40f in KPIM::ProgressItem::setStatus (this=0x8c852a8, v=@0x8c852a8)
    at progressmanager.cpp:117
#7  0x4dc7d095 in KMail::PopAccount::slotData (this=0x84f3ae8, job=0x8d19370, 
    data=@0xbfca05a0) at popaccount.cpp:888
#8  0x4dc7d922 in KMail::PopAccount::qt_invoke (this=0x84f3ae8, _id=8, 
    _o=0xbfca06e0) at qucom_p.h:312
#9  0x4bf41053 in QObject::activate_signal (this=0x8d19370, clist=0x84f4088, 
    o=0xbfca06e0) at qconnection.h:56
#10 0xb772a211 in KIO::TransferJob::data (this=0xbfca071c, t0=0x8c852a8, 
    t1=@0x8c852a8) at jobclasses.moc:993
#11 0xb7714e54 in KIO::TransferJob::slotData (this=0x8d19370, 
    _data=@0x8c852a8) at job.cpp:902
#12 0xb772a72a in KIO::TransferJob::qt_invoke (this=0x8d19370, _id=18, 
    _o=0xbfca0800) at qucom_p.h:312
#13 0x4bf41053 in QObject::activate_signal (this=0x8cb6750, clist=0x8d19560, 
    o=0xbfca0800) at qconnection.h:56
#14 0xb7706b68 in KIO::SlaveInterface::data (this=0x8cb6750, t0=@0x8c852a8)
    at slaveinterface.moc:194
#15 0xb7705095 in KIO::SlaveInterface::dispatch (this=0x8cb6750, _cmd=100, 
    rawdata=@0xbfca0b10) at slaveinterface.cpp:234
#16 0xb7704e09 in KIO::SlaveInterface::dispatch (this=0x8cb6750)
    at slaveinterface.cpp:173
#17 0xb770295b in KIO::Slave::gotInput (this=0x8cb6750) at slave.cpp:300
#18 0xb7704567 in KIO::Slave::qt_invoke (this=0x8cb6750, _id=4, _o=0xbfca0c40)
    at slave.moc:113
#19 0x4bf41053 in QObject::activate_signal (this=0x8b09de0, clist=0x8abb9b8, 
    o=0xbfca0c40) at qconnection.h:56
#20 0x4bf411ad in QObject::activate_signal (this=0x8b09de0, signal=2, 
    param=1270397440) at qobject.cpp:2448
#21 0x4c275c72 in QSocketNotifier::activated (this=0x8c852a8, t0=147346088)
    at qmetaobject.h:261
#22 0x4bf5d16e in QSocketNotifier::event (this=0x8b09de0, e=0xbfca1090)
    at qsocketnotifier.cpp:258
#23 0x4bee5b3c in QApplication::internalNotify (this=0x8c852a8, 
    receiver=0x8b09de0, e=0xbfca1090) at qapplication.cpp:2615
#24 0x4bee4edd in QApplication::notify (this=0xbfca2470, receiver=0x8b09de0, 
    e=0xbfca1090) at qapplication.cpp:2372
#25 0xb7116e32 in KApplication::notify (this=0xbfca2470, receiver=0x8b09de0, 
    event=0xbfca1090) at kapplication.cpp:550
#26 0x4bed5795 in QEventLoop::activateSocketNotifiers (this=0x8168328)
    at qeventloop_unix.cpp:579
#27 0x4be8f87f in QEventLoop::processEvents (this=0x8168328, flags=4)
    at qeventloop_x11.cpp:383
#28 0x4bef7a98 in QEventLoop::enterLoop (this=0x8168328) at qeventloop.cpp:198
#29 0x4bee5dd1 in QApplication::enter_loop (this=0xbfca2470)
    at qapplication.cpp:2790
#30 0x4c0c5fc1 in QDialog::exec (this=0xbfca13b0) at qdialog.cpp:432
#31 0x4db2b449 in AccountsPageReceivingTab::slotModifySelectedAccount (
    this=0x8ccd8f0) at configuredialog.cpp:1272
#32 0x4db56496 in AccountsPageReceivingTab::qt_invoke (this=0x8ccd8f0, 
    _id=48, _o=0x8c852a8) at configuredialog_p.moc:967
#33 0x4bf41053 in QObject::activate_signal (this=0x8ccbe50, clist=0x8c7a688, 
    o=0xbfca1790) at qconnection.h:56
#34 0x4c28737b in QListView::doubleClicked (this=0x8ccbe50, t0=0x8c852a8)
    at moc_qlistview.cpp:397
#35 0xb7458eda in KListView::contentsMouseDoubleClickEvent (this=0x8ccbe50, 
    e=0xbfca1860) at klistview.cpp:877
#36 0x4c052f62 in QScrollView::viewportMouseDoubleClickEvent (this=0x8ccbe50, 
    e=0xbfca1f10) at qscrollview.cpp:1765
#37 0x4c05276a in QScrollView::eventFilter (this=0x8ccbe50, obj=0x8caa4e8, 
    e=0xbfca1f10) at qscrollview.cpp:1507
#38 0x4c021758 in QListView::eventFilter (this=0x8ccbe50, o=0x8caa4e8, 
    e=0xbfca1f10) at qlistview.cpp:3841
#39 0x4bf3ea0e in QObject::activate_filters (this=0x8caa4e8, e=0xbfca1f10)
    at qobject.cpp:902
#40 0x4bf3e936 in QObject::event (this=0x8caa4e8, e=0xbfca1f10)
    at qobject.cpp:735
#41 0x4bf7673f in QWidget::event (this=0x8caa4e8, e=0xbfca1f10)
    at qwidget.cpp:4658
#42 0x4bee5b3c in QApplication::internalNotify (this=0x8c852a8, 
    receiver=0x8caa4e8, e=0xbfca1f10) at qapplication.cpp:2615
#43 0x4bee4ff0 in QApplication::notify (this=0xbfca2470, receiver=0x8caa4e8, 
    e=0xbfca1f10) at qapplication.cpp:2421
#44 0xb7116e32 in KApplication::notify (this=0xbfca2470, receiver=0x8caa4e8, 
    event=0xbfca1f10) at kapplication.cpp:550
#45 0x4be7a78c in QETWidget::translateMouseEvent (this=0x8caa4e8, 
    event=0x4c3a8310) at qapplication_x11.cpp:4242
#46 0x4be783fc in QApplication::x11ProcessEvent (this=0xbfca2470, 
    event=0xbfca2380) at qapplication_x11.cpp:3555
#47 0x4be8fdfb in QEventLoop::processEvents (this=0x8168328, flags=4)
    at qeventloop_x11.cpp:192
#48 0x4bef7a98 in QEventLoop::enterLoop (this=0x8168328) at qeventloop.cpp:198
#49 0x4bef7948 in QEventLoop::exec (this=0x8168328) at qeventloop.cpp:145
#50 0x4bee5d71 in QApplication::exec (this=0xbfca2470)
    at qapplication.cpp:2758
#51 0x08059619 in main (argc=147346088, argv=0x8c852a8) at main.cpp:177
Comment 1 Ingo Klöcker 2006-07-05 22:06:55 UTC
SVN commit 558673 by kloecker:

Fix progress item related crashes during POP3 fetches.

BUGS: 110487, 118112, 119112, 121384, 127210, 130303


 M  +4 -1      kmaccount.cpp  
 M  +30 -20    popaccount.cpp  


--- branches/KDE/3.5/kdepim/kmail/kmaccount.cpp #558672:558673
@@ -444,8 +444,11 @@
   if (mTimer)
     mTimer->start(mInterval*60000);
   if ( mMailCheckProgressItem ) {
-    mMailCheckProgressItem->setComplete(); // that will delete it
+    // set mMailCheckProgressItem = 0 before calling setComplete() to prevent
+    // a race condition
+    ProgressItem *savedMailCheckProgressItem = mMailCheckProgressItem;
     mMailCheckProgressItem = 0;
+    savedMailCheckProgressItem->setComplete(); // that will delete it
   }
 
   emit newMailsProcessed( mNewInFolder );
--- branches/KDE/3.5/kdepim/kmail/popaccount.cpp #558672:558673
@@ -348,8 +348,9 @@
 void PopAccount::slotAbortRequested()
 {
   if (stage == Idle) return;
-  disconnect( mMailCheckProgressItem, SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ),
-           this, SLOT( slotAbortRequested() ) );
+  if ( mMailCheckProgressItem )
+    disconnect( mMailCheckProgressItem, SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ),
+                this, SLOT( slotAbortRequested() ) );
   stage = Quit;
   if (job) job->kill();
   job = 0;
@@ -655,7 +656,8 @@
     processMsgsTimer.start(processingDelay);
   }
   else if (stage == Retr) {
-    mMailCheckProgressItem->setProgress( 100 );
+    if ( mMailCheckProgressItem )
+      mMailCheckProgressItem->setProgress( 100 );
     processRemainingQueuedMessages();
 
     mHeaderDeleteUids.clear();
@@ -732,20 +734,22 @@
     // If there are messages to delete then delete them
     if ( !idsOfMsgsToDelete.isEmpty() ) {
       stage = Dele;
-      mMailCheckProgressItem->setStatus(
-        i18n( "Fetched 1 message from %1. Deleting messages from server...",
-              "Fetched %n messages from %1. Deleting messages from server...",
-              numMsgs )
-        .arg( mHost ) );
+      if ( mMailCheckProgressItem )
+        mMailCheckProgressItem->setStatus(
+          i18n( "Fetched 1 message from %1. Deleting messages from server...",
+                "Fetched %n messages from %1. Deleting messages from server...",
+                numMsgs )
+          .arg( mHost ) );
       url.setPath("/remove/" + idsOfMsgsToDelete.join(","));
       kdDebug(5006) << "url: " << url.prettyURL() << endl;
     } else {
       stage = Quit;
-      mMailCheckProgressItem->setStatus(
-        i18n( "Fetched 1 message from %1. Terminating transmission...",
-              "Fetched %n messages from %1. Terminating transmission...",
-              numMsgs )
-        .arg( mHost ) );
+      if ( mMailCheckProgressItem )
+        mMailCheckProgressItem->setStatus(
+          i18n( "Fetched 1 message from %1. Terminating transmission...",
+                "Fetched %n messages from %1. Terminating transmission...",
+                numMsgs )
+          .arg( mHost ) );
       url.setPath(QString("/commit"));
       kdDebug(5006) << "url: " << url.prettyURL() << endl;
     }
@@ -760,11 +764,12 @@
       mUidsOfNextSeenMsgsDict.remove( mUidForIdMap[*it] );
     }
     idsOfMsgsToDelete.clear();
-    mMailCheckProgressItem->setStatus(
-      i18n( "Fetched 1 message from %1. Terminating transmission...",
-            "Fetched %n messages from %1. Terminating transmission...",
-            numMsgs )
-      .arg( mHost ) );
+    if ( mMailCheckProgressItem )
+      mMailCheckProgressItem->setStatus(
+        i18n( "Fetched 1 message from %1. Terminating transmission...",
+              "Fetched %n messages from %1. Terminating transmission...",
+              numMsgs )
+        .arg( mHost ) );
     KURL url = getUrl();
     url.setPath(QString("/commit"));
     job = KIO::get( url, false, false );
@@ -783,8 +788,11 @@
       int numMessages = canceled ? indexOfCurrentMsg : idsOfMsgs.count();
       BroadcastStatus::instance()->setStatusMsgTransmissionCompleted(
         this->name(), numMessages, numBytes, numBytesRead, numBytesToRead, mLeaveOnServer, mMailCheckProgressItem );
-      mMailCheckProgressItem->setComplete();
+      // set mMailCheckProgressItem = 0 before calling setComplete() to prevent
+      // a race condition
+      ProgressItem *savedMailCheckProgressItem = mMailCheckProgressItem;
       mMailCheckProgressItem = 0;
+      savedMailCheckProgressItem->setComplete(); // that will delete it
       checkDone( ( numMessages > 0 ), canceled ? CheckAborted : CheckOK );
     }
   }
@@ -873,7 +881,9 @@
       numMsgBytesRead = curMsgLen;
     numBytesRead += numMsgBytesRead - oldNumMsgBytesRead;
     dataCounter++;
-    if (dataCounter % 5 == 0)
+    if ( mMailCheckProgressItem &&
+         ( dataCounter % 5 == 0 ||
+           ( indexOfCurrentMsg + 1 == numMsgs && numMsgBytesRead == curMsgLen ) ) )
     {
       QString msg;
       if (numBytes != numBytesToRead && mLeaveOnServer)