[master] 38e70fad8 increase default stack size on 32bit to 52k

Nils Goroll nils.goroll at uplex.de
Fri Mar 15 10:05:10 UTC 2019


commit 38e70fad828fd43279e5e99c59972fbeebad82e4
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Mar 15 10:58:52 2019 +0100

    increase default stack size on 32bit to 52k
    
    Our stack space canary in v00004.vtc fell off the twig on fedora rawhide
    i686
    
    Thank you to @ingvarha for testing, reporting and all your support
    overall!

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index c27df71f7..5a1c0ca29 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -644,7 +644,7 @@ MCF_InitParams(struct cli *cli)
 		MCF_ParamConf(MCF_DEFAULT, "http_req_size", "12k");
 		MCF_ParamConf(MCF_DEFAULT, "gzip_buffer", "4k");
 		MCF_ParamConf(MCF_MAXIMUM, "vsl_space", "1G");
-		def = 48 * 1024;
+		def = 52 * 1024;
 	}
 
 	low = sysconf(_SC_THREAD_STACK_MIN);
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index d13463f41..53488b175 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -498,7 +498,7 @@ relative to the values listed below, in order to conserve VM space:
 * http_req_size: 12k
 * gzip_buffer: 4k
 * vsl_space: 1G
-* thread_pool_stack: 48k
+* thread_pool_stack: 52k
 
 .. _List of Parameters:
 
diff --git a/doc/sphinx/whats-new/changes-6.2.rst b/doc/sphinx/whats-new/changes-6.2.rst
index 8da9bfd04..2fea0f335 100644
--- a/doc/sphinx/whats-new/changes-6.2.rst
+++ b/doc/sphinx/whats-new/changes-6.2.rst
@@ -35,18 +35,20 @@ and/or :ref:`ref_param_thread_pools`.
 Parameters
 ~~~~~~~~~~
 
-The default value for :ref:`ref_param_thread_pool_stack` on 64-bit
-platforms has been increased to 56k (from 48k). Recently we had
-occasional reports of stack overflow, apparently related to changes in
-external libraries that are not under control of the Varnish project
-(such as glibc). This may also have been related to stack overflow
-issues on some platforms when recent versions of `jemalloc`_, the
-recommended memory allocator for Varnish, have been used together with
-`pcre`_ with JIT compilation enabled. Compiler hardening flags may
-also increase stack usage and on some systems such stack protector
-flags may be enabled by default. With the addition of new mitigations
-to new compiler releases, stack consumption may also increase on that
-front.
+The default value of :ref:`ref_param_thread_pool_stack` has been
+increased from 48k to 56k on 64-bit platforms and to 52k on 32-bit
+platforms.
+
+Recently we had occasional reports of stack overflow, apparently
+related to changes in external libraries that are not under control of
+the Varnish project (such as glibc). This may also have been related
+to stack overflow issues on some platforms when recent versions of
+`jemalloc`_, the recommended memory allocator for Varnish, have been
+used together with `pcre`_ with JIT compilation enabled. Compiler
+hardening flags may also increase stack usage and on some systems such
+stack protector flags may be enabled by default. With the addition of
+new mitigations to new compiler releases, stack consumption may also
+increase on that front.
 
 Tests have shown that Varnish runs stably with the new default stack
 size on a number of platforms, under conditions that previously may
diff --git a/doc/sphinx/whats-new/upgrading-6.2.rst b/doc/sphinx/whats-new/upgrading-6.2.rst
index 5aaed3d42..3659a664a 100644
--- a/doc/sphinx/whats-new/upgrading-6.2.rst
+++ b/doc/sphinx/whats-new/upgrading-6.2.rst
@@ -43,9 +43,10 @@ now.  These are:
 
 * ``vmod_dir`` -- use :ref:`ref_param_vmod_path` instead
 
-The default value of :ref:`ref_param_thread_pool_stack` on 64-bit
-platforms has been increased to 56k (from 48k). See the discussion
-under :ref:`whatsnew_changes_params_2019_03` in
+The default value of :ref:`ref_param_thread_pool_stack` has been
+increased from 48k to 56k on 64-bit platforms and to 52k on 32-bit
+platforms. See the discussion under
+:ref:`whatsnew_changes_params_2019_03` in
 :ref:`whatsnew_changes_2019_03` for details.
 
 .. _whatsnew_upgrading_std_conversion_2019_03:
diff --git a/include/tbl/params.h b/include/tbl/params.h
index c60b48e2b..de34fb931 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1313,7 +1313,7 @@ PARAM(
 	/* typ */	bytes,
 	/* min */	"2k",
 	/* max */	NULL,
-	/* default */	"48k",
+	/* default */	"56k",
 	/* units */	"bytes",
 	/* flags */	EXPERIMENTAL,
 	/* s-text */


More information about the varnish-commit mailing list