From 7c31cabf59db3304145dbb040e58778dc76ad841 Mon Sep 17 00:00:00 2001 From: MSoliankoLuxoft Date: Fri, 9 Aug 2024 10:57:17 +0300 Subject: [PATCH] Set stack size when run agent (#3934) Set up a custom stack size for the web module creation process. On certain platforms, the default stack size is insufficient, leading to stack overflow issues. b/357525935 (cherry picked from commit 039052d7415e685b49f3a7c8e58bcf88e156a464) --- cobalt/web/agent.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cobalt/web/agent.cc b/cobalt/web/agent.cc index 39b71ef410ed..b987b909dd4e 100644 --- a/cobalt/web/agent.cc +++ b/cobalt/web/agent.cc @@ -585,8 +585,9 @@ void Agent::Run(const Options& options, InitializeCallback initialize_callback, DestructionObserver* destruction_observer) { // Start the dedicated thread and create the internal implementation // object on that thread. - if (!thread_.StartWithOptions(base::Thread::Options(options.thread_priority))) - return; + base::Thread::Options thread_options(options.thread_priority); + thread_options.stack_size = options.stack_size; + if (!thread_.StartWithOptions(std::move(thread_options))) return; DCHECK(task_runner()); // Registers service worker thread as a watchdog client.