Review Request 125613: Race condition and error notification loss in ListJob
Thomas Lübking
thomas.luebking at gmail.com
Mon Oct 12 20:53:40 BST 2015
> On Okt. 12, 2015, 7:29 nachm., Albert Astals Cid wrote:
> > Do you think you can add an unittest for this or is it hard to recreate the conditionts?
>
> Alberto Jiménez Ruiz wrote:
> It happens to very few people. Most developers tried to reproduce bug 333436 and bug 162211(I believe they are closely related) with no luck. The heart of this bug is that sometimes a child ListJob fails silently and I emulated an "error" making an unaccessable folder. A unit test for this would need root privileges.
>
> When I ran across this bug copying stuff with dolphin, I tried to recreate it copying folders thousands of times. I couldn't.
>
> Albert Astals Cid wrote:
> Why would you need test privileges to create a folder you can't access, that's doable without being root, no?
"Depends" - your file, your control.
You can remove and re-add permissions at will; kio might be too "smart to" be challenged by permissions, but chattr might come to the rescue (ie. turn the inaccessible file immutable - kio not smart enough for /that/ ;-)
- Thomas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125613/#review86738
-----------------------------------------------------------
On Okt. 12, 2015, 7:11 nachm., Alberto Jiménez Ruiz wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125613/
> -----------------------------------------------------------
>
> (Updated Okt. 12, 2015, 7:11 nachm.)
>
>
> Review request for kdelibs.
>
>
> Bugs: 333436
> http://bugs.kde.org/show_bug.cgi?id=333436
>
>
> Repository: kdelibs
>
>
> Description
> -------
>
> Race condition and error notification loss in ListJob
>
>
> Diffs
> -----
>
> kio/kio/job.cpp 91712e3
> kio/kio/jobclasses.h d771cfe
>
> Diff: https://git.reviewboard.kde.org/r/125613/diff/
>
>
> Testing
> -------
>
> Tests done on Kubuntu 15.10:
>
> With this folder structure in ~:
> src
> ######c (Folder)
> ##############b (Folder chmod'ed to 700 and owned by root)
> #######################d (10MB file made of /dev/urandom data)
> ##############a (10MB file made of /dev/urandom data)
>
> Then, (as a normal user execute: "kioclient ~/src ~/dst")
>
> Expected result: Notification that some files were not able to be copied (Cannot access "b" folder)
> Result with latest kdelibs: Silent copying where b folder is owned by user but nothing inside.
> ---When all kdebugdialog flags are set, a backtrace is also seen.
>
> subError notifications for listjob subjobs are lost, Copyjob uses this signal to skip data.
>
> Also, this fix prevents a race condition.
>
> ListJob has another ListJob as a subjob.
>
> Chaild fails for whatever reason and calls error, which calls slotError, which calls slotsFinished and emitResult.
> The result of the child gets collected by parent. slotResult of parent gets called, removes subjob and emitsresult because there are no subjobs left.
> ---That's fine as long as the slave associated with the parent emits finished before the child fails. If it doesn't, parent calls emitsResult twice.
>
>
> Result after patch: kioclient shows a MessageBox telling the copy operation could not be completed.
>
>
> Thanks,
>
> Alberto Jiménez Ruiz
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20151012/8257b82c/attachment.htm>
More information about the kde-core-devel
mailing list