aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongodb/musl-available-stack.patch
blob: 4774b6210aa6decaf3a9ad13ba6b83d99e7b9a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- mongodb-src-r3.2.1/src/mongo/scripting/mozjs/implscope.cpp.orig
+++ mongodb-src-r3.2.1/src/mongo/scripting/mozjs/implscope.cpp
@@ -258,7 +258,13 @@
             //
             // TODO: What if we are running on a platform with very
             // large pages, like 4MB?
-            JS_SetNativeStackQuota(_runtime, available.get() - (64 * 1024));
+            //JS_SetNativeStackQuota(_runtime, available.get() - (64 * 1024));
+
+            // For musl libc: We adjust the reserved quota to 32k instead of
+            // 64k because the default musl libc thread stack size is small
+            // (80k) and we can not set stack size for C++ threads.
+            // Note also that with musl, stack size does not include guard page.
+            JS_SetNativeStackQuota(_runtime, available.get() - (32 * 1024));
         }
 
         // The memory limit is in megabytes