From: James Addison Date: Wed, 14 Jan 2026 00:19:18 +0000 (+0100) Subject: Harmonize V8 stack sizes on ARM architectures to match almost all other architectures X-Git-Tag: archive/raspbian/22.22.0+dfsg+_cs22.19.6-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b1c8a4df58e1f489ce8bb4a5d5a3569f2ab86536;p=nodejs.git Harmonize V8 stack sizes on ARM architectures to match almost all other architectures Last-Update: 2023-02-28 Forwarded: https://github.com/nodejs/node/issues/41163 Gbp-Pq: Topic arm64 Gbp-Pq: Name stacksize.patch --- diff --git a/deps/v8/src/common/globals.h b/deps/v8/src/common/globals.h index 00e855c47..612392b4f 100644 --- a/deps/v8/src/common/globals.h +++ b/deps/v8/src/common/globals.h @@ -146,33 +146,9 @@ namespace internal { #define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL false #endif -#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 -// Set stack limit lower for ARM and ARM64 than for other architectures because: -// - on Arm stack allocating MacroAssembler takes 120K bytes. -// See issue crbug.com/405338 -// - on Arm64 when running in single-process mode for Android WebView, when -// initializing V8 we already have a large stack and so have to set the -// limit lower. See issue crbug.com/v8/10575 -#define V8_DEFAULT_STACK_SIZE_KB 864 -#elif V8_TARGET_ARCH_IA32 -// In mid-2022, we're observing an increase in stack overflow crashes on -// 32-bit Windows; the suspicion is that some third-party software suddenly -// started to consume a lot more stack memory (before V8 is even initialized). -// So we speculatively lower the ia32 limit to the ARM limit for the time -// being. See crbug.com/1346791. -#define V8_DEFAULT_STACK_SIZE_KB 864 -#elif V8_USE_ADDRESS_SANITIZER -// ASan makes C++ frames consume more stack, so V8 should leave more stack -// space available in case a C++ call happens. ClusterFuzz found a case where -// even just 1 KB less than the default stack size would be enough (see -// crbug.com/1486275); to be more robust towards future CF reports we'll -// use an even lower limit. -#define V8_DEFAULT_STACK_SIZE_KB 960 -#else // Slightly less than 1MB, since Windows' default stack size for // the main execution thread is 1MB. #define V8_DEFAULT_STACK_SIZE_KB 984 -#endif // Helper macros to enable handling of direct C calls in the simulator. #if defined(USE_SIMULATOR) && \