[cmake-developers] [CMake 0013138]: CMake crashes in cmListCommand::HandleInsertCommand

Mantis Bug Tracker mantis at public.kitware.com
Mon Apr 16 16:24:02 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=13138 
====================================================================== 
Reported By:                Andras Lasso
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13138
Category:                   CMake
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-04-16 16:24 EDT
Last Modified:              2012-04-16 16:24 EDT
====================================================================== 
Summary:                    CMake crashes in cmListCommand::HandleInsertCommand
Description: 
CMake crashes when trying to build a Slicer 4.1 extension. The problem is
reproducible with CMake-2.8.8-rc2.

The CMake build scripts are quite complex, so there might be some error in the
scripts, but anyway CMake reject the execution of the invalid command and print
a meaningful error message instead of crashing.

The same build completes without problems on several computers, CMake crashes
only on one computer.


Steps to Reproduce: 
InvokeInitialPass (in cmcommand.h) is called with the following arguments:
args[0]="INSERT"
args[1]="Slicer_LAUNCH_COMMAND"
args[2]="${launch_index}"
args[3]="--launcher-additional-settings"
args[4]="${Slicer_ADDITIONAL_LAUNCHER_SETTINGS}"

after this->Makefile->ExpandArguments(args, expandedArguments)

expandedArguments[0]="INSERT"
expandedArguments[1]="Slicer_LAUNCH_COMMAND"
expandedArguments[2]="-1"
expandedArguments[3]="--launcher-additional-settings"
expandedArguments[4]="E:/src/cmake-2.8.7-vs2005/Source/AdditionalLauncherSettings.ini"

Note that expandedArguments[2]="-1" => this doesn't seem to be correct.

After this cmListCommand::HandleInsertCommand is called, and in that

int item = atoi(args[2].c_str());

=> item = -1

CMake then crashes in the same function at this line:

varArgsExpanded.insert(varArgsExpanded.begin()+item+cnt, args[cc]);

If I change item to 0 then there is no crash.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-04-16 16:24 Andras Lasso   New Issue                                    
======================================================================




More information about the cmake-developers mailing list