D15899: Fiix segfalut on project reload with cmake

Mathias Kraus noreply at phabricator.kde.org
Tue Oct 2 16:02:09 BST 2018


mkraus created this revision.
mkraus added a project: KDevelop.
Herald added a subscriber: kdevelop-devel.
mkraus requested review of this revision.

REVISION SUMMARY
  When a project gets reloaded and a folder was added with a cmake option,
  folder and file items are created and enqueued in FileManagerListJob.
  Then all folder and file items get deleted and when the next
  FileManagerListJob::startNextJob() accesses an element in the queue it's
  a dangling pointer and segfault happens.
  
  BUG: 398822
  
  FIXED-IN: 3.0

TEST PLAN
  Create a project like this. Only CMakeLists.txt really matters. The other files just have to be there and have valid code.
  
  CMakeLists.txt like this
  ========================
  
  cmake_minimum_required(VERSION 3.5)
  project(crash)
  
  option(test "build tests" OFF)
  
  add_library(crash
  
    source/lib.cpp
  
  )
  
  if(test)
  
    add_executable(unittest test/test.cpp)
  
  endif(test)
  ===========
  
  source/lib.cpp
  ==============
  
  int add(int a, int b) {
  
    return a + b;
  
  }
  =
  
  test/test.cpp
  =============
  
  int main() {
  
    return 0;
  
  }
  =
  
  Proceed this steps:
  
  1. Project -> Prune Selection
  2. Project -> Configure Selection
  3. Project -> Open Configuration...
  4. Enable custom "test" cmake option
  5. Click on OK -> segfault without path; no segfault with patch

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15899

AFFECTED FILES
  kdevplatform/interfaces/iproject.h
  kdevplatform/project/abstractfilemanagerplugin.cpp
  kdevplatform/project/abstractfilemanagerplugin.h
  kdevplatform/project/interfaces/iprojectfilemanager.h
  kdevplatform/shell/project.cpp
  kdevplatform/shell/project.h
  kdevplatform/shell/tests/test_projectcontroller.cpp
  kdevplatform/tests/testproject.h
  plugins/cmake/settings/cmakepreferences.cpp

To: mkraus
Cc: kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20181002/7b2b666c/attachment.html>


More information about the KDevelop-devel mailing list