Re: kded4 crash: favicons
- Date: Tue, 6 May 2008 16:18:18 +0700
- From: Sergey Saukh <thelich@xxxxxxxxx>
- Subject: Re: kded4 crash: favicons
In a message on Tuesday 06 May 2008 Thiago Macieira you wrote: > On Tuesday 06 May 2008 09:13:09 Sergey Saukh wrote: > > Hello, > > > > While using konqueror, I've faced a annoynig problem - random kded4 > > crash. While investigating further I've found that it crashes because of > > kded_favicons module. > > > > In function "slotKill" QList<KIO::Job *> is cleared using qDeleteAll. > > While it's said to be a 99% safe, I think that it is that 1% when this > > algorithm leads to random crashes, because using "while.. delete" > > construction eliminates this problem. > > I don't see how. You're replacing six for half a dozen. > > Unless, of course, the KIO::Job destructor somehow recurses back into > accessing d->killJobs's already deleted jobs. > > For that, the following is also a solution: > > QList<KIO::Job *> copy = d->killJobs; > d->killJobs.clear(); > qDeleteAll(copy); Yes, you're right. I've found the real source of this problem. It's in "slotData". Sometimes it's called twice with the same job pointer, so the same object goes to killJobs twice and favicon crashes when "slotKill" tries to delete same object twice. -- Best regards, Sergey A Saukh
--- /usr/local/src/kde4/kdebase-4.0.72/apps/lib/konq/favicons/favicons.cpp.orig 2008-02-28 23:04:23.000000000 +0600
+++ /usr/local/src/kde4/kdebase-4.0.72/apps/lib/konq/favicons/favicons.cpp 2008-05-06 16:09:57.000000000 +0700
@@ -206,6 +206,7 @@
void FavIconsModule::slotData(KIO::Job *job, const QByteArray &data)
{
+ if (! d->killJobs.contains(job) ) {
FavIconsModulePrivate::DownloadInfo &download = d->downloads[job];
unsigned int oldSize = download.iconData.size();
if (oldSize > 0x10000)
@@ -215,6 +216,7 @@
}
download.iconData.resize(oldSize + data.size());
memcpy(download.iconData.data() + oldSize, data.data(), data.size());
+ }
}
void FavIconsModule::slotResult(KJob *job)
Attachment:
signature.asc
Description: This is a digitally signed message part.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
- References:
- kded4 crash: favicons
- From: Sergey Saukh
- Re: kded4 crash: favicons
- From: Thiago Macieira
- kded4 crash: favicons
- Prev by Date: Re: kded4 crash: favicons
- Next by Date: KDE3.3 & kdmrc/dmrc language settings
- Previous by thread: Re: kded4 crash: favicons
- Next by thread: Re: kded4 crash: favicons
- Index(es):