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() {
