aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/default-pthread-stacksize.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/chromium/default-pthread-stacksize.patch')
-rw-r--r--community/chromium/default-pthread-stacksize.patch19
1 files changed, 12 insertions, 7 deletions
diff --git a/community/chromium/default-pthread-stacksize.patch b/community/chromium/default-pthread-stacksize.patch
index 16e4d21e6e..e55317035d 100644
--- a/community/chromium/default-pthread-stacksize.patch
+++ b/community/chromium/default-pthread-stacksize.patch
@@ -1,12 +1,18 @@
---- base/threading/platform_thread_linux.cc.orig
+--- base/threading/platform_thread_linux.cc
+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
+@@ -186,7 +186,8 @@
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
- return 0;
+ // use 8mb like glibc to avoid running out of space
+ return (1 << 23);
---- chrome/app/shutdown_signal_handlers_posix.cc.orig
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+--- chrome/app/shutdown_signal_handlers_posix.cc
+++ chrome/app/shutdown_signal_handlers_posix.cc
-@@ -184,11 +184,19 @@
+@@ -187,11 +187,19 @@
g_shutdown_pipe_read_fd = pipefd[0];
g_shutdown_pipe_write_fd = pipefd[1];
#if !defined(ADDRESS_SANITIZER)
@@ -16,14 +22,13 @@
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
+# endif
#else
++# if defined(__GLIBC__)
// ASan instrumentation bloats the stack frames, so we need to increase the
// stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
+# else
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
+# endif
#endif
ShutdownDetector* detector = new ShutdownDetector(
- g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);