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

Simeon Bird bladud at
Fri Dec 19 18:50:29 GMT 2014

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

Review request for kdelibs.

Repository: kio


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.

This is the same as reviewboard 117345, but on the KF5 kio repository and with a test case.

While I was doing this I also fixed a minor bug in the test suite (which is a separate commit).


  autotests/kdirlistertest.h 70fd16f 
  autotests/kdirlistertest.cpp b588e5b 
  src/core/kcoredirlister.cpp f5c5627 



Tests run


Simeon Bird

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

More information about the kde-core-devel mailing list