Created attachment 59222 [details]
Version: 4.2.1 (using KDE 4.6.2)
If you're have an invalid cmake script and kdevelop tries to parse it can crash.
So far I've found two cases where this happens, but my attempts to reduce it to minimal examples have failed (so my apologies that the test files are large).
The first example has a unterminated if statement (see line 90 in attached CMakeListsCrash.txt)
I actually encountered this when I minimized KDevelop to look at the CMake docs.
The second example is a unterminated string (see line 90 in attached CMakeListsCrash2.txt)
I've attached the backtrace for the first example (the second one give an identical bt).
Note: I used KDevelop 4.2.2 despite putting 4.2.1 in the version field. Also it was compiled from portage.
Steps to Reproduce:
Rename the attached files to CMakeLists.txt (so that kdevelop tries to parse it)
and open them in KDevelop.
Crashes, also, it will try to parse the file when it re-opens the session, so you have to go in and fix the CMakeLists.txt with another editor.
Not crash, maybe hint at a syntax error?
64 bit linux 2.6.39-rc4
CPU: Core i7-2630qm
C/CXXFLAGS: -march=native -mtune=generic -mfpmath=sse -O1 -pipe -ggdb
Created attachment 59223 [details]
Created attachment 59224 [details]
Created attachment 59225 [details]
Proper example2 file.
Git commit 58d96d547b3f46614866f7d75f55e69de5cb0804 by Olivier JG.
Committed on 21/08/2011 at 10:58.
Pushed by olivierjg into branch 'master'.
Use QList by index instead of iterators which can be invalidated in some
cases. Add test.
M +10 -18 projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
M +9 -0 projectmanagers/cmake/tests/cmake_cmakeprojectvisitor_test.cpp