Skip to content
Permalink
Browse files

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!
  • Loading branch information...
nigoroll committed Mar 15, 2019
1 parent 861606d commit 38e70fad828fd43279e5e99c59972fbeebad82e4
@@ -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);
@@ -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:

@@ -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
@@ -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:
@@ -1313,7 +1313,7 @@ PARAM(
/* typ */ bytes,
/* min */ "2k",
/* max */ NULL,
/* default */ "48k",
/* default */ "56k",
/* units */ "bytes",
/* flags */ EXPERIMENTAL,
/* s-text */

0 comments on commit 38e70fa

Please sign in to comment.
You can’t perform that action at this time.