MantisBT - CMake
View Issue Details
0013324CMakeCMakepublic2012-06-20 09:442012-11-05 14:33
jeromerobert 
Brad King 
normalmajoralways
closedfixed 
amd64Debian Wheezy
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013324: Segfault with Swig CPLUSPLUS ON
How to reproduce:

$ cat > CMakeLists.txt
project (Foo C)
cmake_minimum_required(VERSION 2.8)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
set_source_files_properties(foo.i PROPERTIES CPLUSPLUS ON)
swig_add_module(foo python foo.i)

$ touch foo.i
$ cmake .
-- Configuring done
Segmentation fault

Expected result:
A error message saying that it's wrong to enable the CPLUSPLUS property on a C only project.
No tags attached.
Issue History
2012-06-20 09:44jeromerobertNew Issue
2012-06-20 11:30Brad KingAssigned To => Brad King
2012-06-20 11:30Brad KingStatusnew => assigned
2012-06-20 11:35Brad KingNote Added: 0029767
2012-06-20 11:35Brad KingNote Added: 0029768
2012-06-20 11:35Brad KingStatusassigned => resolved
2012-06-20 11:35Brad KingResolutionopen => fixed
2012-06-20 11:35Brad KingFixed in Version => CMake 2.8.9
2012-06-20 11:35Brad KingTarget Version => CMake 2.8.9
2012-11-05 14:33David ColeNote Added: 0031456
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029767)
Brad King   
2012-06-20 11:35   
I was able to narrow this down to the simple test case

 cmake_minimum_required(VERSION 2.8)
 project(FOO NONE)
 add_library(foo SHARED foo.nolang)

Upstream CMake 2.8.8 does not crash on the case. The crash was introduced after 2.8.8 here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1409ac5 [^]

but the patch was backported for Debian CMake 2.8.8:

 http://patch-tracker.debian.org/package/cmake/2.8.8-3 [^]
(0029768)
Brad King   
2012-06-20 11:35   
Fixed and test added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56148fd2 [^]

See commit message for explanation.
(0031456)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.