View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014005CMakeCMakepublic2013-03-12 16:532013-10-07 10:03
ReporterAlexander Polunin 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.10.2 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0014005: terminate called after throwing an instance of 'std::logic_error'
Descriptioncmake source files contain places where you construct std::basic_string from NULL pointer of type const char*. And this leads to cmake termination after throwing std::logic_error exception. Maybe it's not the big problem if you sure that NULL pointers are impossible but at least in one case simple input to cmake leads to its termination in string "cmake-2.8.10.2/Source/kwsys/SystemTools.cxx:1803".

kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
{
  kwsys_stl::string ret = path; // maybe we need to more strict check here
...................................
Steps To Reproduce1) create CMakeLists.txt with content

################Begin##################
include (CTest)
project(ttt)
################End#####################

2) create build folder and go there
3) run cmake with default generator (I have checked it with gcc and MinGW toolchain)
 cmake ..

4) see
terminate called after throwing an instance of 'std::logic_error'
  what(): basic_string::_S_construct null not valid
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032596)
Brad King (manager)
2013-03-12 18:34

Combinations of std::string and const char* are rampant throughout CMake internally. Most places are careful not to construct std::string from NULL.

I refactored the RunCMake.build_command test to allow more cases:

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

Then I fixed this crash and added a test:

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

Then I fixed a related problem and added a test:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d90f49b8 [^]
(0033993)
Robert Maynard (manager)
2013-10-07 10:03

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-03-12 16:53 Alexander Polunin New Issue
2013-03-12 18:34 Brad King Note Added: 0032596
2013-03-12 18:34 Brad King Assigned To => Brad King
2013-03-12 18:34 Brad King Status new => resolved
2013-03-12 18:34 Brad King Resolution open => fixed
2013-03-12 18:34 Brad King Fixed in Version => CMake 2.8.11
2013-03-12 18:34 Brad King Target Version => CMake 2.8.11
2013-10-07 10:03 Robert Maynard Note Added: 0033993
2013-10-07 10:03 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team