[Piglit] [PATCH] mingw: use default 2MB stack size instead of 1MB

Brian Paul brianp at vmware.com
Thu Oct 12 13:43:47 UTC 2017


The op-selection-bool-bvec4-bvec4.frag test has an expression which
adds 512 terms.  This causes 512 levels of recursion in Mesa's
ir_expression::constant_expression_value() function.  Since each
function activation record is about 2KB in size with MSVC, this
causes us to overflow the stack and crash.

The crash was only recently exposed with MSVC 2015 debug builds of Mesa.

The default MinGW stack size of 2MB is enough to avoid this issue.
Since we no longer build Piglit with MSVC, we don't have to match
MSVC's 1MB stack default.
---
 CMakeLists.txt | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4259ec8..cdecca4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -301,9 +301,6 @@ else ()
 endif ()
 
 if (MINGW)
-	# Match MSVC default stack size
-	set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,1048576")
-
 	# Avoid depending on MinGW runtime DLLs
 	check_cxx_compiler_flag (-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
 	if (HAVE_STATIC_LIBGCC_FLAG)
-- 
1.9.1



More information about the Piglit mailing list