Fix for #1382 "linux client crashes for no discernable reason"
authorMariusz Wasak <mawasak@gmail.com>
Tue, 17 Sep 2019 16:39:51 +0000 (18:39 +0200)
committerMariusz Wasak <mawasak@gmail.com>
Wed, 18 Sep 2019 16:18:12 +0000 (18:18 +0200)
There in no "return" in
PropagateUploadFileCommon::slotStartUpload in if (prevModtime != _item-
>_modtime) {... }

There is possibility that
PropagateItemJob::done(status, errorString)
maybe called two times from PropagateUploadFileCommon::slotStartUpload
1. in if (prevModtime != _item->_modtime) {... }
2. in if (fileIsStillChanging(*_item)) {..}
if changes in files are frequent the second call is possible.

This two calls has effect in PropagatorCompositeJob::slotSubJobFinished
and job is removed two times in _runningJobs.remove(i);
(the second time with argumetnt -1 (because first call removed job).

This return was removed in commit
efc039863b096f0e39543001b6cb53937808bebf - by accident I think.

Good simulation is to synchronize firefox profile with frequent page
refresh.

Signed-off-by: Mariusz Wasak <mawasak@gmail.com>
src/libsync/propagateupload.cpp

index ad364b929abd52bec634a7b59fd733cecc0916a3..6ba783a86e5ff455e2c8dc8177ee922a166beebe 100644 (file)
@@ -346,6 +346,7 @@ void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionCh
         }
         qDebug() << "prevModtime" << prevModtime << "Curr" << _item->_modtime;
         done(SyncFileItem::SoftError, tr("Local file changed during syncing. It will be resumed."));
+        return;
     }
 
     quint64 fileSize = FileSystem::getSize(fullFilePath);