View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013912CMake(No Category)public2013-02-13 10:312013-07-01 09:37
ReporterMathäus Mendel 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version7
Product VersionCMake 2.8.10.2 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013912: Incorrect settings for Embarcadero compiler
DescriptionThe configuration file used for Embarcadero compiler - Windows-Embarcadero.cmake, at Modules/Platform folder - has incorrect settings. The variable 'CMAKE_EXE_LINKER_FLAGS_INIT' is set as "${_tM} -lS:10000000 -lSc:10000000 ", overriding the default configuration for stack and heap allocation/commit.
Steps To ReproduceThe issue can be reproduced using a binary that allocates a lot of memory in a short time span, running on a system with memory pagination disabled. The memory commit size will increase and the system will hang or become unstable.
Additional InformationThe ideal configuration to be passed to the linker would be:

set (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:1048576 -lSc:4098 -lH:1048576 -lHc:8192")

It will force the linker to use the default settings for stack and heap memory allocation/usage.
TagsNo tags attached.
Attached Files

 Relationships
related to 0012437closedDavid Cole Default link line includes massive stack size of 10M with the /STACK:10000000 option 

  Notes
(0032258)
Brad King (manager)
2013-02-13 13:02

For reference, the history of the current flags lies in these commits from 2003:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c70beb4b [^]
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b572eb9 [^]
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d411398 [^]

The large stack size was added to MS tools back then also. However, that was removed recently:

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

A similar change is in order for Embarcadero tools.
(0032259)
Brad King (manager)
2013-02-13 13:03

Also for reference, here is documentation of the flags in question:

http://docwiki.embarcadero.com/RADStudio/XE3/en/ILINK32.EXE,_the_32-bit_Incremental_Linker [^]

/H:xxxx Specifies application heap reserve size in hex or decimal. Minimum
         value is 0. This switch overrides the HEAPSIZE setting in a module
         definition file. Default is 1 MB (0x1000000).
                                            0x100000 = 1048576
/HC:nnnn Specifies application heap commit size.
/S:xxxx Specifies application stack reserve size.
/Sc:xxxx Specifies application stack commit size.
(0032260)
Brad King (manager)
2013-02-13 13:05

Interestingly the default listed in the documentation for /H:xxxx says 1MB in words but the value given is actually 16MB. We'll have to assume the extra 0 in the value is a typo.

While I'm not opposed to the new defaults you propose, what is wrong with just leaving the flags out completely as is now done for MS and Intel tools?
(0032262)
Mathäus Mendel (reporter)
2013-02-13 13:11

Because the Embarcadero compiler has wrong default values too. If you leave the parameters empty, it will use another stack/heap size. I'm still not sure why, but we are instrumenting the compiler and our test machines to better understand the case.

As we didn't want to put random values, we just set the default ones mentioned in the documentation; the entire system now works.
(0032267)
Mathäus Mendel (reporter)
2013-02-13 13:47

In the Module Definition documentation, both stack and heap values are mentioned:

http://docwiki.embarcadero.com/RADStudio/XE3/en/Module_Definition_Files#HEAPSIZE_Statement [^]
http://docwiki.embarcadero.com/RADStudio/XE3/en/Module_Definition_Files#STACKSIZE_Statement [^]
(0032268)
Brad King (manager)
2013-02-13 13:57

Fix applied:

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

Thanks for the detailed information and answers.
(0033421)
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
2013-02-13 10:31 Mathäus Mendel New Issue
2013-02-13 13:02 Brad King Note Added: 0032258
2013-02-13 13:03 Brad King Relationship added related to 0012437
2013-02-13 13:03 Brad King Note Added: 0032259
2013-02-13 13:05 Brad King Note Added: 0032260
2013-02-13 13:11 Mathäus Mendel Note Added: 0032262
2013-02-13 13:47 Mathäus Mendel Note Added: 0032267
2013-02-13 13:57 Brad King Note Added: 0032268
2013-02-13 13:57 Brad King Assigned To => Brad King
2013-02-13 13:57 Brad King Status new => resolved
2013-02-13 13:57 Brad King Resolution open => fixed
2013-02-13 13:57 Brad King Fixed in Version => CMake 2.8.11
2013-02-13 13:57 Brad King Target Version => CMake 2.8.11
2013-07-01 09:37 Robert Maynard Note Added: 0033421
2013-07-01 09:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team