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 B1FD3DC03EA for ; Wed, 24 Feb 2016 09:33:04 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 94966DC00A8 for ; Wed, 24 Feb 2016 09:33:02 +0000 (UTC) Received: from mfilter46-d.gandi.net (mfilter46-d.gandi.net [217.70.178.177]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id C8922172094; Wed, 24 Feb 2016 10:33:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter46-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter46-d.gandi.net (mfilter46-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 0p-s7YKgaymk; Wed, 24 Feb 2016 10:33:00 +0100 (CET) X-Originating-IP: 193.248.36.207 Received: from [192.168.1.217] (LCaen-656-1-170-207.w193-248.abo.wanadoo.fr [193.248.36.207]) (Authenticated sender: marc.vertes@ugrid.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id F1F6C1720E0; Wed, 24 Feb 2016 10:32:59 +0100 (CET) Content-Type: text/plain; charset=utf-8 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: [alpine-aports] [PATCH] testing/mongodb: fix for #5117 From: Marc Vertes In-Reply-To: <20160224084437.2b11cbe1@vostro.util.wtbts.net> Date: Wed, 24 Feb 2016 10:32:59 +0100 Cc: alpine-aports@lists.alpinelinux.org Content-Transfer-Encoding: quoted-printable Message-Id: <7AA15BC7-7B5F-4973-ADEC-6ADCADECD11F@ugrid.net> References: <1456247469-958-1-git-send-email-marc.vertes@ugrid.net> <20160223191612.6f25f25b@vostro> <6B28E7B4-454F-4391-AA4E-498D73DD811A@ugrid.net> <20160223194440.3fc44b9a@vostro> <2309A9D8-2394-4092-8BF5-BA4E3C13870F@ugrid.net> <20160224084437.2b11cbe1@vostro.util.wtbts.net> To: Timo Teras X-Mailer: Apple Mail (2.3112) X-Virus-Scanned: ClamAV using ClamSMTP > Le 24 f=C3=A9vr. 2016 =C3=A0 07:44, Timo Teras a = =C3=A9crit : >=20 > On Tue, 23 Feb 2016 23:46:39 +0100 > Marc Vertes wrote: >=20 >>> Le 23 f=C3=A9vr. 2016 =C3=A0 18:44, Timo Teras a = =C3=A9crit : >>>=20 >>> So the current patch is wrong. pthread_getattr_np returns valid and >>> correct data for non-main threads. Only main thread should get the >>> "treatment". >>>=20 >> Ok, I agree, there is no need to patch the reporting of stack base / >> size which are correct (obtained by pthread_getattr_np in a non-main >> thread). >>=20 >> So the real problem comes from the small default stack size (80k) >> imposed by musl. >>=20 >> I saw that reducing the quota from 64k to 32k in >> StackLocator.available() which checks remaining stack space, was >> enough to avoid the initial crash. >=20 > Should we start by applying that one? At least to make mongdb compile > again as my change broke the build (bad checksums). I'm preparing a new patch, removing musl-process-stack-size.patch and adjusting the check of minimum available stack space from 64k to 32k. =20 >=20 >> So the normal thing to do would be increase a bit the stack space for >> created threads. >>=20 >> I can't use pthread_attr_setstacksize before pthread_create, because >> of the use of C++ threads (what a pile of crap!). I tried to force a >> non-zero stacksize in PR_CreateThread(), but it seems to do nothing. >=20 > Urgh. Yeah, that looks abhorrent. I'll ping #musl what could be done. >=20 >> The 2 last remaining options: test if g++ -fsplit-stack would work, >> or reduce quota as mentioned before. >>=20 >> What do you think ? >=20 > split-stack has it's own problems too. IIRC, it breaks other stuff. = And > requires gold linker to even work (we have it, but do not use it be > default). >=20 Ok, I won't proceed further on that. > glibc ships pthread_setattr_default_np() that can be used to change = the > default stack size. I wonder if some similar mechanism could be added > to musl. >=20 It would be certainly useful to ease porting multi-threaded C++ stuff = needing big stack space for their threads. It's not because alpine and musl are concise and elegant that they should not support big bloated craps. > But as said, maybe start with changing the marginal from 64->32kB? > In musl the stack size does not contain the guard page (which is in > agreement with posix's definition of thread attribute stack = base/size). > The comment did say the check is not done often enough though, so that > might not be desirable long term solution. And that should probably be > explained in the patch. >=20 Yes. Will do that. Thanks, Marc --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---