Mail archive

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

From: Timo Teras <>
Date: Mon, 22 Feb 2016 08:57:45 +0200

On Sun, 21 Feb 2016 19:36:23 +0000
Marc Vertes <> 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 ?

The problem is like the fact that the app uses pthread_getattr_np to
get the main thread's attributes, and then pthread_attr_getstack to
figure out the main stack's size.

Musl in this case seems to report the actual committed stack size.
Basically current stack size rounded up to one or two pages. Where as
the application is likely expecting to get the upper bound to which the
stack can grow - basically the virtual address space size reserved by
the kernel for stack.

As alternative it was suggested to use getrlimit(RLIMIT_STACK) for the
main thread.

I guess this is subject to debate which is the correct thing to do in
pthread_attr_getstack for the main thread. Returning the commit size
gives you size that you can access and it's guaranteed to not fail.

We are currently discussing this on #musl. But perhaps it'd be better
to do it on the mailing list.


Received on Mon Feb 22 2016 - 08:57:45 UTC