Increase Windows stack size to 8M (#1998)

* Increase Windows stack size to 8M

* try to add stack size cmake
This commit is contained in:
IOBYTE 2019-07-15 06:39:58 -04:00 committed by Daniel Marjamäki
parent af051a3787
commit c2ccfd5f8b
6 changed files with 48 additions and 6 deletions

View File

@ -177,6 +177,8 @@
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>$(TargetDir)cli.pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(TargetDir)cli.pdb</ProgramDatabaseFile>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|Win32'">
@ -202,6 +204,8 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -225,6 +229,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
@ -248,6 +254,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -282,6 +290,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|Win32'">
@ -316,6 +326,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -350,6 +362,8 @@
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
@ -384,6 +398,8 @@
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View File

@ -121,6 +121,10 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -U_GLIBCXX_DEBUG") set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -U_GLIBCXX_DEBUG")
endif() endif()
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8000000")
endif()
include(cmake/dynamic_analyzer_options.cmake REQUIRED) include(cmake/dynamic_analyzer_options.cmake REQUIRED)
# Add user supplied extra options (optimization, etc...) # Add user supplied extra options (optimization, etc...)

View File

@ -237,10 +237,8 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
std::set<unsigned int> notzero, std::set<unsigned int> notzero,
unsigned int recursiveCount) unsigned int recursiveCount)
{ {
// The C++ standard suggests a minimum of 256 nested control statements if (++recursiveCount > 1000) // maximum number of "else if ()"
// but MSVC has a limit of 100. throw InternalError(startToken, "Internal limit: CheckLeakAutoVar::checkScope() Maximum recursive count of 1000 reached.", InternalError::LIMIT);
if (++recursiveCount > 100)
throw InternalError(startToken, "Internal limit: CheckLeakAutoVar::checkScope() Maximum recursive count of 100 reached.", InternalError::LIMIT);
std::map<unsigned int, VarInfo::AllocInfo> &alloctype = varInfo->alloctype; std::map<unsigned int, VarInfo::AllocInfo> &alloctype = varInfo->alloctype;
std::map<unsigned int, std::string> &possibleUsage = varInfo->possibleUsage; std::map<unsigned int, std::string> &possibleUsage = varInfo->possibleUsage;

View File

@ -295,6 +295,8 @@
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -323,6 +325,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -349,6 +353,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -376,6 +382,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -414,6 +422,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -453,6 +463,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -490,6 +502,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y
@ -528,6 +542,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y <Command>xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y

View File

@ -1823,7 +1823,7 @@ private:
"#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n" "#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n"
"void foo() {\n" "void foo() {\n"
" if (0) { }\n" " if (0) { }\n"
" THOU\n" " THOU THOU\n"
"}"), InternalError); "}"), InternalError);
ASSERT_NO_THROW(checkP("#define ONE if (0) { }\n" ASSERT_NO_THROW(checkP("#define ONE if (0) { }\n"
"#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE\n" "#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE\n"
@ -1831,7 +1831,7 @@ private:
"#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n" "#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN\n"
"void foo() {\n" "void foo() {\n"
" if (0) { }\n" " if (0) { }\n"
" THOU\n" " THOU THOU\n"
"}")); "}"));
} }

View File

@ -195,6 +195,8 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -221,6 +223,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -259,6 +263,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<LargeAddressAware>true</LargeAddressAware> <LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -298,6 +304,8 @@
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum> <SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />