| Summary: | kmail crash downloading pop3 msg without action of user | ||
|---|---|---|---|
| Product: | [Unmaintained] kmail | Reporter: | rapsys <rapsys> |
| Component: | general | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Mandriva RPMs | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
the kdbg output of crash_kmail_downloading_pop3_msg_without_action
the xsession-error output of crash_kmail_downloading_pop3_msg_without_action |
||
|
Description
rapsys
2006-07-05 16:41:44 UTC
Created attachment 16896 [details]
the kdbg output of crash_kmail_downloading_pop3_msg_without_action
Created attachment 16897 [details]
the xsession-error output of crash_kmail_downloading_pop3_msg_without_action
Pasting the backtrace
#6 0xb715e3e9 in QMap<KPIM::ProgressItem*, bool>::isEmpty (this=0x892e6e8)
at /usr/lib/qt3/include/qmap.h:722
#7 0xb7dbefce in KMail::PopAccount::slotJobFinished (this=0x884c9a0)
at popaccount.cpp:785
#8 0xb7dc0e20 in KMail::PopAccount::slotCancel (this=0x884c9a0)
at popaccount.cpp:300
#9 0xb7dc0ea3 in KMail::PopAccount::slotResult (this=0x884c9a0)
at popaccount.cpp:981
#10 0xb7dc1141 in KMail::PopAccount::qt_invoke (this=0x884c9a0, _id=9,
_o=0xbfa872a4) at popaccount.moc:120
#11 0xb5bdbc84 in QObject::activate_signal ()
from /usr/lib/qt3/lib/libqt-mt.so.3
#12 0xb684d277 in KIO::Job::result (this=0x8a1e5e8, t0=0x8a1e5e8)
at jobclasses.moc:162
#13 0xb686da1c in KIO::Job::emitResult (this=0x8a1e5e8) at job.cpp:226
#14 0xb687db56 in KIO::SimpleJob::slotFinished (this=0x8a1e5e8) at job.cpp:574
#15 0xb688a8e9 in KIO::TransferJob::slotFinished (this=0x8a1e5e8)
at job.cpp:944
#16 0xb68426e3 in KIO::SimpleJob::slotError (this=0x8a1e5e8, error=28,
errorText=@0x83f5ba0) at job.cpp:585
#17 0xb686c3ee in KIO::SimpleJob::qt_invoke (this=0x8a1e5e8, _id=14,
_o=0xbfa87640) at jobclasses.moc:424
#18 0xb686c574 in KIO::TransferJob::qt_invoke (this=0x8a1e5e8, _id=14,
_o=0xbfa87640) at jobclasses.moc:1082
#19 0xb5bdbbe1 in QObject::activate_signal ()
from /usr/lib/qt3/lib/libqt-mt.so.3
#20 0xb685fc33 in KIO::SlaveInterface::error (this=0x89a7198, t0=28,
t1=@0xbfa87820) at slaveinterface.moc:214
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)
|