From f61507fc1cfadd89e15805f3608b581485c115c0 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 31 Dec 2022 18:18:31 -0800 Subject: [PATCH] increase stack size on Windows to 32MB This repairs the long chain test after it was previously inadvertently broken. Technically going to 32MB is not necessary on all platforms; in release mode, the MS Build built Graphviz can handle this example with only a 16MB stack. But it seems simpler to uniformly go to 32MB on all Windows platforms. In a 64-bit address space, 32MB is trivial and we could even adjust this limit higher in future. Note that this is the reserved size, not the committed size. Gitlab: #1710 --- CHANGELOG.md | 2 ++ cmd/dot/CMakeLists.txt | 6 ++++++ cmd/dot/dot.vcxproj | 4 ++-- tests/regression_tests/large/test_large_graphs.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85eae01f4..be55ee0d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `--enable-python` is now an alias for `--enable-python3`. - The CMake build system, when building `gvedit`, will now look for and use Qt6 in preference over Qt5. #2233 +- Reserved stack size on Windows for the `dot.exe` binary has been increased + from ~3.8MB to 32MB. #1710 ### Fixed diff --git a/cmd/dot/CMakeLists.txt b/cmd/dot/CMakeLists.txt index e1f8c883a..b4fdac874 100644 --- a/cmd/dot/CMakeLists.txt +++ b/cmd/dot/CMakeLists.txt @@ -21,6 +21,12 @@ target_link_libraries(dot gvc ) +if(MINGW) + set_target_properties(dot PROPERTIES LINK_FLAGS -Wl,--stack,0x2000000) +elseif(WIN32) + set_target_properties(dot PROPERTIES LINK_FLAGS /STACK:"33554432") +endif() + # Installation location of executables install( TARGETS dot diff --git a/cmd/dot/dot.vcxproj b/cmd/dot/dot.vcxproj index bbfbe4d2e..af0797c2e 100644 --- a/cmd/dot/dot.vcxproj +++ b/cmd/dot/dot.vcxproj @@ -68,7 +68,7 @@ MachineX86 cgraph.lib;gvc.lib;%(AdditionalDependencies) - 4000000 + 33554432 $(OutDir)dot -c @@ -99,7 +99,7 @@ copy /B /Y $(OutDir)dot.exe $(OutDir)twopi.exe MachineX86 cgraph.lib;gvc.lib;%(AdditionalDependencies) - 4000000 + 33554432 $(OutDir)dot -c diff --git a/tests/regression_tests/large/test_large_graphs.py b/tests/regression_tests/large/test_large_graphs.py index d0dbeb995..c6dc579fd 100644 --- a/tests/regression_tests/large/test_large_graphs.py +++ b/tests/regression_tests/large/test_large_graphs.py @@ -12,7 +12,7 @@ import pytest sys.path.append(os.path.join(os.path.dirname(__file__), "../../../tests")) from gvtest import dot #pylint: disable=wrong-import-position -@pytest.mark.xfail(platform.system() in ("Darwin", "Windows"), +@pytest.mark.xfail(platform.system() == "Darwin", reason="https://gitlab.com/graphviz/graphviz/-/issues/1710") def test_long_chain(): """ -- 2.40.0