MantisBT - CMake
View Issue Details
0013901CMakeCMakepublic2013-02-08 11:262013-10-07 10:04
Orion Poplawski 
Brad King 
normalminoralways
closedfixed 
LinuxFedora18
CMake 2.8.10.2 
CMake 2.8.11CMake 2.8.11 
0013901: cmake . -DCMAKE_CXX_COMPILER= results in segfault
$ touch CMakeLists.txt
$ cmake . -DCMAKE_CXX_COMPILER=
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/lib64/ccache/cc
-- Check for working C compiler: /usr/lib64/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!
Segmentation fault (core dumped)
Program terminated with signal 11, Segmentation fault.
#0 _M_grab (__alloc2=..., __alloc1=..., this=0x4c49504d4f435f40)
    at /usr/src/debug/gcc-4.7.2-20121109/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:226
226 ? _M_refcopy() : _M_clone(__alloc1);
Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.6-7.fc18.x86_64 cyrus-sasl-lib-2.1.23-37.fc18.x86_64 libacl-2.2.51-7.fc18.x86_64 libattr-2.4.46-7.fc18.x86_64 libidn-1.26-1.fc18.x86_64 libssh2-1.4.3-1.fc18.x86_64 nss-softokn-freebl-3.14.2-3.fc18.x86_64 openssl-libs-1.0.1c-7.fc18.x86_64 xz-libs-5.1.2-2alpha.fc18.x86_64
(gdb) bt
#0 _M_grab (__alloc2=..., __alloc1=..., this=0x4c49504d4f435f40)
    at /usr/src/debug/gcc-4.7.2-20121109/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:226
#1 std::string::assign (this=0x7ffffcc25358, __str=
    <error reading variable: Cannot access memory at address 0x4c49504d4f435f40>)
    at /usr/src/debug/gcc-4.7.2-20121109/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.tcc:251
0000002 0x00000000004fc07a in operator= (__str=
    <error reading variable: Cannot access memory at address 0x4c49504d4f435f40>,
    this=0x7ffffcc25358) at /usr/include/c++/4.7.2/bits/basic_string.h:544
0000003 cmake::HandleDeleteCacheVariables (this=0x7ffffcc258c0, var=<optimized out>)
    at /usr/src/debug/cmake-2.8.10.2/Source/cmake.cxx:2070
0000004 0x00000000004fca46 in cmake::Run (this=0x7ffffcc258c0,
    args=std::vector of length 3, capacity 4 = {...}, noconfigure=false)
    at /usr/src/debug/cmake-2.8.10.2/Source/cmake.cxx:2478
0000005 0x000000000048eee1 in do_cmake (ac=3, av=0x7ffffcc25c38)
    at /usr/src/debug/cmake-2.8.10.2/Source/cmakemain.cxx:529
0000006 0x000000000048c369 in main (ac=3, av=0x7ffffcc25c38)
    at /usr/src/debug/cmake-2.8.10.2/Source/cmakemain.cxx:338
(gdb) up 3
0000003 cmake::HandleDeleteCacheVariables (this=0x7ffffcc258c0, var=<optimized out>)
    at /usr/src/debug/cmake-2.8.10.2/Source/cmake.cxx:2070
2070 save.value = *i;
(gdb) print i
$1 = <error reading variable: Cannot access memory at address 0x4c49504d4f435f40>
(gdb) print argsSplit
$3 = std::vector of length 1, capacity 1 = {"CMAKE_CXX_COMPILER"}
No tags attached.
related to 0006102closed Bill Hoffman Changing compilers should be an easier operation 
has duplicate 0014016closed  cmake segfaults with empty -DCMAKE_CXX_COMPILER 
related to 0013756closed Brad King Infinite loop when reconfiguring with different CMAKE_C_COMPILER 
Issue History
2013-02-08 11:26Orion PoplawskiNew Issue
2013-02-08 16:39Brad KingRelationship addedrelated to 0006102
2013-02-08 16:39Brad KingRelationship addedrelated to 0013756
2013-02-08 16:43Brad KingNote Added: 0032239
2013-02-08 16:43Brad KingAssigned To => Brad King
2013-02-08 16:43Brad KingStatusnew => resolved
2013-02-08 16:43Brad KingResolutionopen => fixed
2013-02-08 16:43Brad KingFixed in Version => CMake 2.8.11
2013-02-08 16:43Brad KingTarget Version => CMake 2.8.11
2013-02-20 08:11Brad KingNote Added: 0032353
2013-03-15 08:19Brad KingRelationship addedhas duplicate 0014016
2013-10-07 10:04Robert MaynardNote Added: 0034007
2013-10-07 10:04Robert MaynardStatusresolved => closed

Notes
(0032239)
Brad King   
2013-02-08 16:43   
I've fixed the crash:

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

but have no time to add a test case covering the feature, let alone the crash case. Since the feature was added for 0006102 a lot more state has been added to the build tree that is not in the CMakeCache.txt to simply clearing it is not always sufficient anymore. IMO the feature needs a major overhaul or should be removed.

(0032353)
Brad King   
2013-02-20 08:11   
Test added here:

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

including coverage of the -DCMAKE_C_COMPILER="" case.
(0034007)
Robert Maynard   
2013-10-07 10:04   
Closing resolved issues that have not been updated in more than 4 months.