Bug 280136

Summary: Kdevelop crashes with "while(1" in CMakeLists.txt.
Product: [Applications] kdevelop Reporter: Ambroz Bizjak <ambrop7>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash CC: aleixpol, kde
Priority: VHI    
Version: 4.2.3   
Target Milestone: 4.2.3   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: backtrace from crash

Description Ambroz Bizjak 2011-08-15 17:40:50 UTC
Created attachment 62848 [details]
backtrace from crash

Version:           4.2.3 (using KDE 4.7.0) 
OS:                Linux

Probably the shortest CMakeLists.txt which crashes KDevelop: :)

while(1

The crash seems to be infinite recursion ending in stack overflow. Part of backtrace is attached. The crash is not in the text editor but in the CMake project manager; you need to restart KDevelop or let it reload the CMakeLists.txt to make it crash.

Reproducible: Always

Steps to Reproduce:
Use the following CMakeLists.txt file:

while(1

Actual Results:  
Segmentation fault.

Expected Results:  
No segmentation faule.
Comment 1 Rolf Eike Beer 2011-08-16 17:55:13 UTC
Can confirm the bug. KDevelop 4.2.3 on openSUSE 11.4 running KDE 4.6.4.
Comment 2 Milian Wolff 2011-08-27 17:25:08 UTC
can confirm - Aleix, can you take a shot at fixing this please?
Comment 3 Aleix Pol 2011-09-01 04:24:01 UTC
Git commit 4edc197c25f288a329e96dae093412020a0451fb by Aleix Pol.
Committed on 01/09/2011 at 06:22.
Pushed by apol into branch '4.2'.

If a while expression is unfinished, don't execute it at all.

BUG: 280136

M  +13   -11   projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
M  +11   -1    projectmanagers/cmake/tests/cmake_cmakeprojectvisitor_test.cpp

http://commits.kde.org/kdevelop/4edc197c25f288a329e96dae093412020a0451fb
Comment 4 Aleix Pol 2011-09-01 04:24:04 UTC
Git commit c02d272da560cc68f18bad129fda5a2356b6231a by Aleix Pol.
Committed on 01/09/2011 at 06:22.
Pushed by apol into branch 'master'.

If a while expression is unfinished, don't execute it at all.

BUG: 280136

M  +13   -11   projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
M  +11   -1    projectmanagers/cmake/tests/cmake_cmakeprojectvisitor_test.cpp

http://commits.kde.org/kdevelop/c02d272da560cc68f18bad129fda5a2356b6231a