Layout-2020: Fix debug mode crash for servo.org

servo with layout-2020 segfaults when loading servo.org
in debug build, but works fine in release build.

It seems like the style pool threads seem to run
overrun allocated stack space more quickly than
in release mode.

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1376883
it seems the stack size was chosen base on several
experiments. It is possible the results of those experiments
are no longer valid.

This is a temporary workaround to avoid layout 2020
builds from crashing when servo.org is loaded, until
we can confirm the theory and implement a more robust
solution.

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
This commit is contained in:
Mukilan Thiyagarajan 2023-05-24 21:35:20 +05:30
parent 05239f879e
commit 17238b56a1

View file

@ -32,8 +32,14 @@ use rayon;
use smallvec::SmallVec;
/// The minimum stack size for a thread in the styling pool, in kilobytes.
#[cfg(feature = "gecko")]
pub const STYLE_THREAD_STACK_SIZE_KB: usize = 256;
/// The minimum stack size for a thread in the styling pool, in kilobytes.
/// Servo requires a bigger stack in debug builds.
#[cfg(feature = "servo")]
pub const STYLE_THREAD_STACK_SIZE_KB: usize = 512;
/// The stack margin. If we get this deep in the stack, we will skip recursive
/// optimizations to ensure that there is sufficient room for non-recursive work.
///