Fix lifetime of slot in KIO-MTP
ClosedPublic

Authored by feverfew on Apr 2 2020, 4:17 PM.

Details

Summary

This slot was incorrectly made to last the lifetime of the slave. In fact, this
slot should only be live for the lifetime of the event loop (one I/O operation).

This can cause issues with the data being emitted for data from other IO
operations. By making it live in the lifetime of the local event loop this
scenario cannot occur as LIBMTP only allows one operation at a time.

Test Plan

Via the use of KIOFuse (as this is where the bug was noticed).
Before: Opening a file for the first time worked. Subsequent opens would fail
due to garbage output After: Opening any number of files at any time works.

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
feverfew created this revision.Apr 2 2020, 4:17 PM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptApr 2 2020, 4:17 PM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
feverfew requested review of this revision.Apr 2 2020, 4:17 PM
apol accepted this revision.Apr 2 2020, 5:25 PM
apol added a subscriber: apol.

Makes sense

This revision is now accepted and ready to land.Apr 2 2020, 5:25 PM
feverfew updated this revision to Diff 79196.Apr 3 2020, 10:50 AM
  • Fix another slot lifetime

@apol just found another one where this occurs, forgot about it but noticed it earlier as well. This doesn't affect KIOFuse as much though (as we don't listen to the processedSize() signal).

I'll wait for another approval, or before 20.04 tagging, whichever comes first :P

apol accepted this revision.Apr 3 2020, 1:06 PM
meven accepted this revision.Apr 4 2020, 10:11 AM
elvisangelaccio accepted this revision.Apr 5 2020, 3:26 PM

Please push to 20.04, there is still time.

This revision was automatically updated to reflect the committed changes.