diff options
author | Marc Vertes <marc.vertes@ugrid.net> | 2016-02-24 10:03:40 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-02-24 11:51:14 +0000 |
commit | 2191d52882a51f7365b4a676305020215d3b0226 (patch) | |
tree | 2000f7440cdb102ed2f67f3640cef1c682f1c688 /testing/mongodb | |
parent | a148c910b9b3d31765e4d315b0db4f5195ffeb82 (diff) | |
download | aports-2191d52882a51f7365b4a676305020215d3b0226.tar.bz2 aports-2191d52882a51f7365b4a676305020215d3b0226.tar.xz |
testing/mongodb: Fix mongo shell "too much recursion" #5117
The problem is due to the fact that spidermonkey expects a
larger available space on the thread stack than the one
allocated by default by Musl libc.
In the code which checks the available stack space, 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.
Diffstat (limited to 'testing/mongodb')
-rw-r--r-- | testing/mongodb/APKBUILD | 10 | ||||
-rw-r--r-- | testing/mongodb/musl-available-stack.patch | 17 | ||||
-rw-r--r-- | testing/mongodb/musl-process-stack-size.patch | 22 |
3 files changed, 22 insertions, 27 deletions
diff --git a/testing/mongodb/APKBUILD b/testing/mongodb/APKBUILD index 5e4334dfdc..88cb3b95f7 100644 --- a/testing/mongodb/APKBUILD +++ b/testing/mongodb/APKBUILD @@ -2,7 +2,7 @@ pkgname=mongodb pkgver=3.2.1 -pkgrel=3 +pkgrel=4 pkgdesc='A high-performance, open source, schema-free document-oriented database' url='http://www.mongodb.org' arch='x86_64' @@ -18,7 +18,7 @@ source="http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz 40-fix-elf-native-class.patch backtrace.patch fix-asio-strerror_r.patch - musl-process-stack-size.patch + musl-available-stack.patch boost160.patch mongodb.confd @@ -96,7 +96,7 @@ md5sums="a9f150f8bead9e8afd3ab28492167073 mongodb-src-r3.2.1.tar.gz 04a348397be8ca7471d404056d8a1490 40-fix-elf-native-class.patch 86a988b5d4402227d177b8a1167008e8 backtrace.patch cd0833592e3a23e729ebd71eb756318c fix-asio-strerror_r.patch -ec2789bf3ea42f230cc9861f575e9075 musl-process-stack-size.patch +a0e1d0ef5df415965a20a5da67d853c9 musl-available-stack.patch 1df24dc2aa6b8f4c6da22f097a921ebb boost160.patch 7d2f94bed7bfacd32fcd52dfd931f077 mongodb.confd 792a0b53b3e843cf14176c5beb8cdfe1 mongodb.initd @@ -108,7 +108,7 @@ sha256sums="50431a3ba5ab68bd0bed4a157a8528ca27753a63cf101f13135255e4e9d42f15 mo 3a863660113d29728d7a852b3fba73926697b496848f8ccc4d8e73e6614cfdfc 40-fix-elf-native-class.patch 300d9f6b819730de54018d4b418eb7f921ba9c83fad4958a040544b076160848 backtrace.patch ec6d404221f02706ef2e52e00e414e98666dcc3606e78c9b3d33dfbd42a1eae7 fix-asio-strerror_r.patch -dcecbee54355f61e628c807a0dd000ed861916f083d111e110d5b0ea3596d7c6 musl-process-stack-size.patch +68dba3180f0aedac2a3b9f868723552a2945882e53c9635e0d0585be9fd1e47b musl-available-stack.patch 0e9da35f4303e53daf51e78961c517895f2d12f4fa49298f01e1665e15246d73 boost160.patch a4ca29c577428c02cd0b0a8b46756df5f53a05519c9d13c270533cf99b9b819d mongodb.confd 7e39fbd4dc18dba21c8767931683f4795e58e0e91b9f9a5842539923ded453c9 mongodb.initd @@ -120,7 +120,7 @@ b9fdacb273d5a4e1e60735846b262287f84ca6cbded9393d182f69158d3162a50cae5d834f76860d 56db8f43afc94713ac65b174189e2dd903b5e1eff0b65f1bdac159e52ad4de6606c449865d73bd47bffad6a8fc339777e2b11395596e9a476867d94a219c7925 40-fix-elf-native-class.patch 7d097f497cb910c9cb81086cd8c222e43456d1a6de4adfe3e97a4d99add454279350fdeb7305dab84b3deca04afd824036d4065ee0fb8cdd8c03e96d98ee86af backtrace.patch f829b1ad542db3ee776d444243b8b47ab4e48a7386d9b199d7b1adafd31556cf173a5683b78ee735d6a69999ad9af5ad152fde955bbe8865f7910718991ce97c fix-asio-strerror_r.patch -7a8f37ef94c3530617bbab234b9e360ab1746d621fe30aa3830ec42d3571a26c07891daeaaf28a97427e3296d313d5499b80b856411f4c56234297f9952c8653 musl-process-stack-size.patch +4251ad85c6a76cb5d87e7e1a3bb2f67c6abb046b3c145b86201310d89b43e99f3b4124da8a8df1f92dfcbcfc2187c14c14a85f48980cfd419ddb2e38508da071 musl-available-stack.patch 385c82875174caae433a3b381eb10f98a6fed0c8943788ddefff1de80a898e480bdbbf094a7783285cf2ae11ce3fc6878e57d58183d05be2f0837b206aaa4da6 boost160.patch 9bcd870742c31bf25f34188ddc3c414de1103e9860dea9f54eee276b89bc2cf1226abab1749c5cda6a6fb0880e541373754e5e83d63cc7189d4b9c274fd555c3 mongodb.confd 2cb295ac0eb44acb4533c86d6d0988d5f760361a43cff7845713f3e2cf0e37023d23790a2926c613bf2b0668060c0b68d59000db52daaacd8af10e701a8b4192 mongodb.initd diff --git a/testing/mongodb/musl-available-stack.patch b/testing/mongodb/musl-available-stack.patch new file mode 100644 index 0000000000..4774b6210a --- /dev/null +++ b/testing/mongodb/musl-available-stack.patch @@ -0,0 +1,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 diff --git a/testing/mongodb/musl-process-stack-size.patch b/testing/mongodb/musl-process-stack-size.patch deleted file mode 100644 index dd45abb8ed..0000000000 --- a/testing/mongodb/musl-process-stack-size.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- mongodb-src-r3.2.1.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp -+++ mongodb-src-r3.2.1/src/mongo/platform/stack_locator_pthread_getattr_np.cpp -@@ -31,6 +31,7 @@ - #include "mongo/platform/stack_locator.h" - - #include <pthread.h> -+#include <sys/resource.h> - - #include "mongo/util/assert_util.h" - #include "mongo/util/scopeguard.h" -@@ -52,6 +53,11 @@ - invariant(result == 0); - invariant(base != nullptr); - invariant(size != 0); -+ -+ struct rlimit rl; -+ -+ invariant(getrlimit(RLIMIT_STACK, &rl) == 0); -+ size = rl.rlim_cur ? : 2 * 1024 * 1024; - - // TODO: Assumes a downward growing stack. Note here that - // getstack returns the stack *base*, being the bottom of the |