Review Request 105404: Quit LibArchiveInterface::list() and the associated ListJob before deleting LibArchiveInterface in Archive's destructor

Nathan Mills nn.dm55 at gmail.com
Tue Oct 27 07:34:24 UTC 2015


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

(Updated Oct. 27, 2015, 7:34 a.m.)


Status
------

This change has been discarded.


Review request for KDE Utils and Raphael Kubo da Costa.


Bugs: 193908
    http://bugs.kde.org/show_bug.cgi?id=193908


Repository: ark


Description
-------

This patch fixes the crash when initially opening an archive with Ark using libarchive. The patch prevents a Job from using a deleted LibArchiveInterface by making sure that the Job quits before the LibArchiveInterface is deleted.
When an Archive instance is being destroyed, the destructor first asks its ReadOnlyArchiveInterface instance to quit. The instance, which is really a LibArchiveInterface, then waits for its list() method to quit. Then the Archive instance's destructor waits for the most recently started Job to quit. Archive's destructor only waits for the Job to quit if the Archive's ReadOnlyArchiveInterface supports doKill().
This patch could easily be extended to other Jobs as follows: For DeleteJob, the interface's doKill() method needs to quit the deleteFiles() call cleanly. For ExtractJob, the interface's doKill() method needs to quit copyFiles() cleanly. For AddJob, the interface's doKill() method needs to quit the addFiles() method cleanly. These three jobs should probably ask the user whether to continue with the operation, halt the operation, or delete the added/copied files.


Diffs
-----

  kerfuffle/archive.h 515788f 
  kerfuffle/archive.cpp c2c5b18 
  kerfuffle/jobs.h d704dfc 
  kerfuffle/jobs.cpp aedc62c 
  plugins/libarchive/libarchivehandler.h 9ec7541 
  plugins/libarchive/libarchivehandler.cpp cd473ee 

Diff: https://git.reviewboard.kde.org/r/105404/diff/


Testing
-------

I started the patched version of Ark with a large tar archive and a small tar archive pressing Ctrl+Q each time. Then I reverted the patch, compiled Ark, and compared how long the unpatched version took to quit to make sure the patch didn't cause excessively long waits.


Thanks,

Nathan Mills

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20151027/888a6c49/attachment.html>


More information about the Kde-utils-devel mailing list