<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/105404/">http://git.reviewboard.kde.org/r/105404/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDE Utils and Raphael Kubo da Costa.</div>
<div>By Nathan Mills.</div>
<p style="color: grey;"><i>Updated Oct. 26, 2012, 5:53 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If LibArchiveInterface::doKill() is called before list() sets m_listing, the check for whether list() is running in Archive's destructor will succeed, causing LibArchiveInterface to be deleted. Protect against this by returning from list() immediately if this ever happens.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=193908">193908</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kerfuffle/archive.h <span style="color: grey">(515788f)</span></li>
<li>kerfuffle/archive.cpp <span style="color: grey">(c2c5b18)</span></li>
<li>kerfuffle/jobs.h <span style="color: grey">(d704dfc)</span></li>
<li>kerfuffle/jobs.cpp <span style="color: grey">(aedc62c)</span></li>
<li>plugins/libarchive/libarchivehandler.h <span style="color: grey">(9ec7541)</span></li>
<li>plugins/libarchive/libarchivehandler.cpp <span style="color: grey">(cd473ee)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/105404/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>