Review Request 117394: Kdevelop crash when setting CMake variables bugfix suggestion
Pavel Petrushkov
onehundredof at gmail.com
Mon Apr 7 03:32:20 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117394/
-----------------------------------------------------------
(Updated April 7, 2014, 3:32 a.m.)
Status
------
This change has been discarded.
Review request for KDevelop.
Repository: kdevelop
Description
-------
Explanation of bug:
After CMake settings were changed file watcher starts reloading project via CMakeManager::reload. At the same time settings dialog(CMakePreferences.cpp) starts reloading same project via Project::reloadModel() after running cmakejob. Problem is that CMakeManager doesn't set project's private loading variable so reloadModel starts working and deletes project's root ProjectFolderItem(topItem). First reload still has a pointer to that deleted ProjectFolderItem and it crashes while trying to access it. These bugs: 332934, 328699, 312314 have very similar backtraces -- they all have two threads running CMakeImportJob::initialize(which are hidden in kdevcmakemanager.so) and one of them is crashing while trying to reference ProjectBaseItem::url(::path in newer versions). Also, bug happens only sometimes, that's probably because first reload manages to finish before second one starts. On faster PCs and bigger projects bug may not be detectable. Changing CMAKE_BUILD_TYPE almost always crashes my KDevelop.
Solution suggestion:
I haven't come up with solution that doesn't look ugly so I'll just post one. Since I haven't found a public method to set project's loading var I just call Project::reloadModel() instead of creating import job manually. Project is going to be reloaded anyway so it should not break anything except it reloads 2 times now. Also doing that kind of makes CMakeManager::reload useless. Perhaps I should call reloadModel from cmakemanager only when CMakeCache.txt was changed and manual job in other cases? Anyway I need your advice on how to properly fix the problem.
Diffs
-----
projectmanagers/cmake/cmakemanager.cpp 7a34b37
Diff: https://git.reviewboard.kde.org/r/117394/diff/
Testing
-------
Manual, KDevelop doesn't seem to crash anymore.
Thanks,
Pavel Petrushkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140407/432eb310/attachment.html>
More information about the KDevelop-devel
mailing list