Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] testing/mongodb: fix bug #5117 where mongo fails at start

From: Marc Vertes <marc.vertes_at_ugrid.net>
Date: Tue, 23 Feb 2016 15:41:23 +0100

> Le 23 févr. 2016 à 14:07, Timo Teras <timo.teras_at_iki.fi> a écrit :
>
> On Sun, 21 Feb 2016 19:36:23 +0000
> Marc Vertes <marc.vertes_at_ugrid.net> wrote:
>
>> The check for recursion has been disabled, as it makes mongo shell
>> aborting at start. There may be a better fix, perhaps ensuring
>> that recursion is OK under musl, and maybe increasing stack space ?
>
> Could you try if the following works instead:
>
>
> --- /dev/null
> +++ b/testing/mongodb/musl-process-stack-size.patch
> _at_@ -0,0 +1,22 @@
> +--- 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
> +_at_@ -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"
> +_at_@ -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
> --
> 2.7.1
>
It doesn't work. And on my side, I tried a similar modification (using getrlimit) in src/third_party/mozjs-38/extract/js/src/jsnativestack.cpp without success.

But I found a separate patch which works:

--- src/mongo/scripting/mozjs/implscope.cpp.orig
+++ src/mongo/scripting/mozjs/implscope.cpp
_at_@ -258,6 +258,7 @@
             //
             // 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() - (32 * 1024));
         }
 
So I believe that it should be a matter of increasing allocated stack at thread creation. I'm still not able to do that, despite my various attempts.

Marc

---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Feb 23 2016 - 15:41:23 GMT