From b9d3df70e08f1cd37af35b1750426637d498a184 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 17 May 2021 18:03:10 +0100 Subject: [PATCH] LibJS: Increase free stack space required for function calls to 32 kiB The previous 16 kiB weren't sufficient with ASAN enabled and would trigger stack overflow failures. --- Userland/Libraries/LibJS/Runtime/VM.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 7cbac330fc..74f5705099 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -96,8 +96,8 @@ public: { VERIFY(!exception()); // Ensure we got some stack space left, so the next function call doesn't kill us. - // This value is merely a guess and might need tweaking at a later point. - if (m_stack_info.size_free() < 16 * KiB) + // Note: the 32 kiB used to be 16 kiB, but that turned out to not be enough with ASAN enabled. + if (m_stack_info.size_free() < 32 * KiB) throw_exception(global_object, "Call stack size limit exceeded"); else m_call_stack.append(&call_frame);