X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id AD055DC5D95 for ; Tue, 23 Feb 2016 15:04:54 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 3349EDC2BCC for ; Tue, 23 Feb 2016 15:04:52 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id 78so116887507lfy.3 for ; Tue, 23 Feb 2016 07:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Fzq4IDdyeFZuvdCjebTURstbUq3TWvM3tKXeTG838Xc=; b=g1XmB/nkooIFVaZP92cCVmZeJCavEsjvphJ4PmfrC7rklrhGHwgUOZM/4ZCA4lWc+D J0ieJmNauf11Y9ePzsDRK1BOTZ8wHEElbCiPcyVXh0dCParxYe+8w2w0IEJaRbP+iE2I 6ARb/Dgf8xXpJKZiKgi5q97dEdzAm1jeH1XXJQj8Wv92VJZPSWe8mfAiE8gyjqbCxuvm EctsgjsrYZwu2egfwHRfjDc6yntNp847Izoa5EyV7PrMIBK0tnOo7s1yV5NEr7ILZPSF vA2n7kRXi5Ukd7pAtOqXnXeK/QfMCgZR7xbrqM5042uNMriDbfkC9yfTG5NISo8Ue0pR JRMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=Fzq4IDdyeFZuvdCjebTURstbUq3TWvM3tKXeTG838Xc=; b=ZPUrkP9eLQr4b+NDP5qAYS81QIF0qrTVOlJZb1NlPZoRzU0Qewl7QJ3Zr42SeUr1PD KThXjeZ4Hw4iFGeQTm0aSwGAardtzZ3Yvwhj3De1HLIHzwHm8iySqLzgz52V4+lLZ+8R 3dfNhLCH7lA+mHWA7zcZs5EO2V/bUAnOR620YhcQctouBPpfJonudbNjR7ts5QognBiY HGTikJFlCRKYFHwuXAMN3DGIVnTDuceJwmD9iS63gLmTY6n4h/tuodx3qYt+XG66cRMg J2WDJRMrqSfF4lmywxR2h9w1/ouLBwPkKg88yG4VVjW1zh/bv3Z11ySaLxpXY1DV5Cjo W5Fw== X-Gm-Message-State: AG10YORt4gCqVILT1b9EslHnLDn93bUnYClJCMcwS4HhHqizS4iQUkU5VGtazfXe4LEqGw== X-Received: by 10.25.20.86 with SMTP id k83mr12963004lfi.12.1456239889494; Tue, 23 Feb 2016 07:04:49 -0800 (PST) Received: from vostro.util.wtbts.net ([2001:1bc8:101:f402:21a:9fff:fe0c:4022]) by smtp.gmail.com with ESMTPSA id s75sm4097192lfd.38.2016.02.23.07.04.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 07:04:49 -0800 (PST) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Tue, 23 Feb 2016 17:04:46 +0200 From: Timo Teras To: Marc Vertes Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/mongodb: fix bug #5117 where mongo fails at start Message-ID: <20160223170446.483be803@vostro.util.wtbts.net> In-Reply-To: <9D775D86-8A4D-49ED-8512-EBD572ECF6D6@ugrid.net> References: <1456083383-9196-1-git-send-email-marc.vertes@ugrid.net> <20160223150743.33e55efa@vostro.util.wtbts.net> <9D775D86-8A4D-49ED-8512-EBD572ECF6D6@ugrid.net> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.28; x86_64-alpine-linux-musl) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 23 Feb 2016 15:41:23 +0100 Marc Vertes wrote: > 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 > @@ -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. The main thread's stack is allocated by kernel. In practice, kernel maps the stack on virtual address space so that it's size is the stack rlimit, but it only allocates the first pages of it. When the stack is needed more, the kernel automatically commits/allocates more of the stack. Musl returns you the actual size of the stack in use. Glibc returns you the maximum stack size (but kernel might fail to allocate it). Another attempt would be to patch that function to have in the beginning a call to function that has large stack array and that writes to it. Something like: static void commit_stack(void) { char foo[1024*1024*2]; foo[0] = foo[sizeof(foo)-1] = 0; } Assuming gcc will not optimize it away. After this kernel should commit the memory, and musl's pthread_getattr_np should return value reflecting that. /Timo --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---