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

David Faure faure at kde.org
Sun Apr 6 14:41:43 BST 2014



> On April 5, 2014, 9:16 p.m., David Faure wrote:
> > Did you try running the unittests in kio/tests ?
> 
> Simeon Bird wrote:
>     The kdelibs 4 tests all pass. I don't have a working 5 setup, so I didn't test the 5 tests, if they are different.

The KF5 tests are the same, no worries about that.
But what would be good would be to extend the tests in order to make them reproduce the crash you mention... (before applying the fix, of course).


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117345/#review55040
-----------------------------------------------------------


On April 3, 2014, 2:29 a.m., Simeon Bird wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117345/
> -----------------------------------------------------------
> 
> (Updated April 3, 2014, 2:29 a.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> 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
> called.
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   kio/kio/kdirlister.cpp aad6893f47eba81c3f78ed1ca7327adf6fb587bb 
> 
> Diff: https://git.reviewboard.kde.org/r/117345/diff/
> 
> 
> Testing
> -------
> 
> It fixes the crash! It might break something else.
> 
> 
> Thanks,
> 
> Simeon Bird
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140406/d24a47f4/attachment.htm>


More information about the kde-core-devel mailing list