Fix potential crash when aborting a ListJob in libarchive plugin
ClosedPublic

Authored by elvisangelaccio on Sep 25 2016, 10:03 AM.

Details

Summary

Libarchive's error() signal is connected to the Job::onError slot, but when we abort a ListJob, the slot might be called when the job instance has already been deleted. So let's emit this signal only when we are not aborting the job.

BUG: 369283
FIXED-IN: 16.08.2

Test Plan

For some reason, this crash is hard to reproduce (it happened only a couple of times to me). This is surprising because looking at the code I would expect a crash every time...

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio retitled this revision from to Fix potential crash when aborting a ListJob in libarchive plugin.
elvisangelaccio updated this object.
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio added a reviewer: rthomsen.
elvisangelaccio set the repository for this revision to R36 Ark.
Restricted Application added a project: Ark. · View Herald TranscriptSep 25 2016, 10:03 AM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript

By the way, this error message is completely useless because it's either empty or not translated and our "Could not read until the end of the archive" fallback doesn't make much sense.

I vote for killing this signal on master, we can just print the error message on the debug output.

rthomsen accepted this revision.Sep 27 2016, 5:57 AM
rthomsen edited edge metadata.
This revision is now accepted and ready to land.Sep 27 2016, 5:57 AM
This revision was automatically updated to reflect the committed changes.