<table><tr><td style="">mkraus created this revision.<br />mkraus added a project: KDevelop.<br />Herald added a subscriber: kdevelop-devel.<br />mkraus 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/D15899">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When a project gets reloaded and a folder was added with a cmake option,<br />
folder and file items are created and enqueued in FileManagerListJob.<br />
Then all folder and file items get deleted and when the next<br />
FileManagerListJob::startNextJob() accesses an element in the queue it's<br />
a dangling pointer and segfault happens.</p>
<p>BUG: 398822</p>
<p>FIXED-IN: 3.0</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Create a project like this. Only CMakeLists.txt really matters. The other files just have to be there and have valid code.</p>
<h2 class="remarkup-header">CMakeLists.txt like this</h2>
<p>cmake_minimum_required(VERSION 3.5)<br />
project(crash)</p>
<p>option(test "build tests" OFF)</p>
<p>add_library(crash</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">source/lib.cpp</pre></div>
<p>)</p>
<p>if(test)</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">add_executable(unittest test/test.cpp)</pre></div>
<h2 class="remarkup-header">endif(test)</h2>
<h2 class="remarkup-header">source/lib.cpp</h2>
<p>int add(int a, int b) {</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">return a + b;</pre></div>
<h2 class="remarkup-header">}</h2>
<h2 class="remarkup-header">test/test.cpp</h2>
<p>int main() {</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">return 0;</pre></div>
<h2 class="remarkup-header">}</h2>
<p>Proceed this steps:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">Project -> Prune Selection</li>
<li class="remarkup-list-item">Project -> Configure Selection</li>
<li class="remarkup-list-item">Project -> Open Configuration...</li>
<li class="remarkup-list-item">Enable custom "test" cmake option</li>
<li class="remarkup-list-item">Click on OK -> segfault without path; no segfault with patch</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15899">https://phabricator.kde.org/D15899</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/interfaces/iproject.h<br />
kdevplatform/project/abstractfilemanagerplugin.cpp<br />
kdevplatform/project/abstractfilemanagerplugin.h<br />
kdevplatform/project/interfaces/iprojectfilemanager.h<br />
kdevplatform/shell/project.cpp<br />
kdevplatform/shell/project.h<br />
kdevplatform/shell/tests/test_projectcontroller.cpp<br />
kdevplatform/tests/testproject.h<br />
plugins/cmake/settings/cmakepreferences.cpp</div></div></div><br /><div><strong>To: </strong>mkraus<br /><strong>Cc: </strong>kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>