Review Request 117345: Fix crash in KIO due to exposing inconsistent views of internal data.

Simeon Bird bladud at
Tue Apr 21 03:30:02 BST 2015

This is an automatically generated e-mail. To reply, visit:

(Updated April 21, 2015, 2:30 a.m.)


This change has been marked as submitted.

Review request for kdelibs.

Repository: kdelibs


Fix crash in KIO due to exposing inconsistent views of internal data.

This can be triggered by renaming a directory while one of the files in it is open in gwenview.

It occurs because when KDirListerCache::emitRedirections is called,
itemsInUse contains the old url. However, KDirLister::Private::redirect
changes lstDirs to the new url. Thus at this point lstDirs contains an
item not in itemsInUse, which causes an assertion if forgetDirs is

In gwenview, the redirection signal is connected to openURL. This calls
forgetDirs, and causes the assertion.

The solution: update itemsInUse *before* emitting redirections.

This fixes the crash, but gwenview opens the first file in
the new directory instead of the file open before renaming. 
This is probably an unrelated gwenview bug.

I wrote this for kdelibs 4, but the code seems unchanged in kdelibs 5.


  kio/kio/kdirlister.cpp aad6893f47eba81c3f78ed1ca7327adf6fb587bb 



It fixes the crash! It might break something else.


Simeon Bird

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list