<table><tr><td style="">kossebau created this revision.<br />kossebau added a reviewer: KDevelop.<br />Restricted Application added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.<br />kossebau requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D14413">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The old code had the internal ThreadWeaver job being killed via the QObject<br />
child memory management from the outer KJob-based job object.<br />
Though this was done based on a signal emitted from the ThreadWeaver<br />
execution thread, when the internal ThreadWeaver job was still going to be<br />
used by the internal reference in the execution completion code.</p>

<p>While the actual current ThreadWeaver code then is not accessing any member<br />
data and just using the pointer to the otherwisse already deleted object,<br />
this at least is not liked by ASan which detects a heap-use-after-free,<br />
resulting e.g. in failing unit tests on CI now and then.</p>

<p>This patch fixes this by passing the ThreadWeaver job instance via a<br />
QSHaredPointer which then is shared by both the parent KJob and the<br />
ThreadWeaver Queue, so the deletion will be done by the last one handling<br />
it.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Subversion plugin still works for what I tested, unit tests still pass.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>fixsvnjobaccessafterdelete</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14413">https://phabricator.kde.org/D14413</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/subversion/svnblamejob.cpp<br />
plugins/subversion/svndiffjob.cpp<br />
plugins/subversion/svninfojob.cpp<br />
plugins/subversion/svninternaljobbase.cpp<br />
plugins/subversion/svninternaljobbase.h<br />
plugins/subversion/svnjobbase.cpp<br />
plugins/subversion/svnjobbase.h<br />
plugins/subversion/svnlogjob.cpp<br />
plugins/subversion/svnstatusjob.cpp</div></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, antismap, iodelay, vbspam, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>