View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012437CMakeCMakepublic2011-08-31 13:012013-07-01 09:37
ReporterGlenn Coombs 
Assigned ToDavid Cole 
PlatformMicrosoftOSWindowsOS Version7
Product VersionCMake 2.8.5 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0012437: Default link line includes massive stack size of 10M with the /STACK:10000000 option
DescriptionProjects 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 ReproduceCreate 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 Informationcmake_minimum_required(VERSION 2.8)


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

add_executable(foo foo.c)
TagsNo tags attached.
Attached Files

related to 0013912closedBrad King Incorrect settings for Embarcadero compiler 

David Cole (manager)
2012-08-11 11:38

Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
David Cole (manager)
2012-11-23 13:24

Fix pushed and merged to the 'next' branch:;a=commitdiff;h=51af1da3d21b95540888d585fccdaa8d68d1fdd8 [^]
Robert Maynard (manager)
2013-07-01 09:37

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

 Issue History
Date Modified Username Field Change
2011-08-31 13:01 Glenn Coombs New Issue
2012-08-11 11:38 David Cole Status new => backlog
2012-08-11 11:38 David Cole Note Added: 0030301
2012-11-09 07:49 David Cole Target Version => CMake 2.8.11
2012-11-20 17:11 David Cole Assigned To => David Cole
2012-11-20 17:11 David Cole Status backlog => assigned
2012-11-23 13:24 David Cole Note Added: 0031690
2012-11-23 13:24 David Cole Status assigned => resolved
2012-11-23 13:24 David Cole Fixed in Version => CMake 2.8.11
2012-11-23 13:24 David Cole Resolution open => fixed
2013-02-13 13:03 Brad King Relationship added related to 0013912
2013-07-01 09:37 Robert Maynard Note Added: 0033420
2013-07-01 09:37 Robert Maynard Status resolved => closed

Copyright © 2000 - 2018 MantisBT Team