From 039eddb85d9aeca4140e72c15e884805b4feb8ad Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Tue, 23 Sep 2025 21:53:08 +0400 Subject: [PATCH] civetweb: allow the OS to set the stack size The default stack size in civetweb is 102400 (see the CMakeLists[1]). This can lead to stack overflows even in basic usage; Setting this value to 0 lets the OS choose the stack size instead, which results in a more suitable value. [1] https://github.com/civetweb/civetweb/blob/cafd5f8fae3b859b7f8c29feb03ea075c7221497/CMakeLists.txt#L56 --- pkgs/by-name/ci/civetweb/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/ci/civetweb/package.nix b/pkgs/by-name/ci/civetweb/package.nix index 5691d1af3233..7c12e2456849 100644 --- a/pkgs/by-name/ci/civetweb/package.nix +++ b/pkgs/by-name/ci/civetweb/package.nix @@ -40,6 +40,13 @@ stdenv.mkDerivation rec { # The civetweb unit tests rely on downloading their fork of libcheck. "-DCIVETWEB_BUILD_TESTING=OFF" + + # The default stack size in civetweb is 102400 (see the CMakeLists [1]). + # This can lead to stack overflows even in basic usage; + # Setting this value to 0 lets the OS choose the stack size instead, which results in a more suitable value. + # + # [1] https://github.com/civetweb/civetweb/blob/cafd5f8fae3b859b7f8c29feb03ea075c7221497/CMakeLists.txt#L56 + "-DCIVETWEB_THREAD_STACK_SIZE=0" ]; meta = {