aboutsummaryrefslogtreecommitdiffstats
path: root/community/mongodb/fix-default-stacksize.patch
blob: d40a2d4b6e803baceb7fe31a3131f3aabf8407da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff -ru mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
--- mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp	2016-09-26 15:10:04.000000000 +0300
+++ mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp	2016-11-01 10:47:31.062284560 +0200
@@ -35,6 +35,16 @@
 #include "mongo/util/assert_util.h"
 #include "mongo/util/scopeguard.h"
 
+__attribute__((constructor))
+static void set_default_stack_size(void)
+{
+    pthread_attr_t attr;
+    invariant(pthread_attr_init(&attr) == 0);
+    invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
+    pthread_setattr_default_np(&attr);
+    invariant(pthread_attr_destroy(&attr) == 0);
+}
+
 namespace mongo {
 
 StackLocator::StackLocator() {