aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/default-pthread-stacksize.patch
blob: 16e4d21e6ed8891d28090c6d9014f7a088ab55a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- base/threading/platform_thread_linux.cc.orig
+++ base/threading/platform_thread_linux.cc
@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
-  return 0;
+  // use 8mb like glibc to avoid running out of space
+  return (1 << 23);
--- chrome/app/shutdown_signal_handlers_posix.cc.orig
+++ chrome/app/shutdown_signal_handlers_posix.cc
@@ -184,11 +184,19 @@
   g_shutdown_pipe_read_fd = pipefd[0];
   g_shutdown_pipe_write_fd = pipefd[1];
 #if !defined(ADDRESS_SANITIZER)
+# if defined(__GLIBC__)
   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+# else
+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
+# endif
 #else
   // 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);