[cmake-developers] [CMake 0012437]: Default link line includes massive stack size of 10M with the /STACK:10000000 option

Mantis Bug Tracker mantis at public.kitware.com
Wed Aug 31 13:01:49 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12437 
====================================================================== 
Reported By:                Glenn Coombs
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12437
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-08-31 13:01 EDT
Last Modified:              2011-08-31 13:01 EDT
====================================================================== 
Summary:                    Default link line includes massive stack size of 10M
with the /STACK:10000000 option
Description: 
Projects configured by cmake for Visual Studio 2008 (and 2010) set a default
stack size of 10M.  This is quite a large value for a default stack size and
causes multi threaded programs to die with an "out of memory" error message.

We use the SystemC library in our programs and it is quite common to have
programs with between 50 and 200 threads.  With 10M per thread that uses
anything from 500M up to 2G of memory just for the thread stacks.

Can the cmake MSVC generators be changed to not add the /STACK option at all by
default ?  That way MSVC users would get the same stack size when using cmake
configured projects as they would get for non cmake configured projects.

Steps to Reproduce: 
Create a minimal project like the one given below in the additional information
section and then run cmake to configure it for Visual Studio 2008.  Open the
generated solution in Visual Studio 2008 and check the
"Properties=>Linker=>Command Line" section.  You will see that the link line
specifies a stack size of 10M with the /STACK:10000000 option.

Additional Information: 
cmake_minimum_required(VERSION 2.8)

project(foo)

file(WRITE foo.c "int main(int argc, char *argv[]) { return 0; }\n")

add_executable(foo foo.c)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-08-31 13:01 Glenn Coombs   New Issue                                    
======================================================================




More information about the cmake-developers mailing list