Summary: | crash in KDirListerCache::listDir if two KDirListers work on the same directory | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio | Reporter: | Aurelien Gateau <agateau> |
Component: | general | Assignee: | Michael Brade <brade> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Excerpt of a trace when everything goes well.
Excerpt of a trace when it crashes. Proposed patch |
Description
Aurelien Gateau
2003-05-02 00:31:23 UTC
Created attachment 1470 [details]
Excerpt of a trace when everything goes well.
Created attachment 1471 [details]
Excerpt of a trace when it crashes.
Created attachment 1472 [details]
Proposed patch
Aurelien: One semi-related question... I believe that some Konqueror crash reports are related to having two KDirListers working on the same directory.... Does this particular crash when happening w/o debug output produce a crash within KURL::url or similar KURL method? At any rate, I think it'd be better you send this to core-devel or kfm-devel, to make sure dfaure doesn't miss this.. Doh, I should have checked my inbox for the reassign, sorry. <feels stupid> Sick KDirLister usage ;-) Yeah, apart from that, very well spotted, thanks! And thanks a lot for the detailed bugreport. Please apply the patch, I can't think of any bad side effects right now. And if you want, close this report, maybe just with a CCMAIL :) Regards, Michael I would be happy to apply the patch, but I don't run KDE CVS (this patch was against KDE 3.1.1), so I would like to avoid committing some code without compiling it. Can you do it for me? Aur Subject: kdelibs/kio/kio CVS commit by brade: His wish is my command, committing on behalf of Aurelien: fix #57991, crash in KDirListerCache::listDir when called just after another KDirLister's job finished and KDirListerCache::slotResult is emitting the signals. CCMAIL: 57991-done@bugs.kde.org M +7 -6 kdirlister.cpp 1.162 --- kdelibs/kio/kio/kdirlister.cpp #1.161:1.162 @@ -882,9 +882,8 @@ void KDirListerCache::slotEntries( KIO:: else if ( name != dotdot ) { - //kdDebug(7004)<< "Adding " << url.prettyURL() << endl; - KFileItem* item = new KFileItem( *it, url, delayedMimeTypes, true ); Q_ASSERT( item ); + //kdDebug(7004)<< "Adding item: " << item->url() << endl; dir->lstItems->append( item ); @@ -916,4 +915,10 @@ void KDirListerCache::slotResult( KIO::J Q_ASSERT( listers ); + // move the directory to the held directories, do it before emitting + // the signals to make sure it exists in KDirListerCache in case someone + // calls listDir during the signal emission + Q_ASSERT( !urlsCurrentlyHeld[jobUrlStr] ); + urlsCurrentlyHeld.insert( jobUrlStr, listers ); + KDirLister *kdl; @@ -947,8 +952,4 @@ void KDirListerCache::slotResult( KIO::J } } - - // move the directory to the held directories - Q_ASSERT( !urlsCurrentlyHeld[jobUrlStr] ); - urlsCurrentlyHeld.insert( jobUrlStr, listers ); // TODO: hmm, if there was an error and job is a parent of one or more |