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 0A50CDC7043 for ; Wed, 24 Feb 2016 06:44:45 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 83A80DC00DC for ; Wed, 24 Feb 2016 06:44:44 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id 78so5423018lfy.3 for ; Tue, 23 Feb 2016 22:44:44 -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=dJl/1lGaIq5/ZfEKe+3JVcJXGT4gC92XKWVCbdVeX6s=; b=sqCrut4YYLMS1G8qDkslvPf5wvaGQf94XAd2QBtX3yM5Is8nKK78EkSvXLTcaXH3dc 7QPvK2DA6vq8xoKXCjuVPb8QLfsRdFZU3XqGBbSsHJqWpr1ogHvThMwRADtFiYOdgdUl 69lFXfiHrgHba/TIjwNRJG24TnIEXNBqt7syarpfpM4zYkiLpiF5hmYw1Zr8jj/BooeF PZpFBwKSs6DzyPZ3ylWYW28W4QZyu+Uz59dlg2JeVUfb6x+Zp4UK3LJZ5dxjgQciErbL ixS5MJRxa3kemkNtnJG21FX3ftzIJWvMtA/IuVi7OOBk9/XKpWOIbWX8tn+L+seYGu9/ ThfQ== 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=dJl/1lGaIq5/ZfEKe+3JVcJXGT4gC92XKWVCbdVeX6s=; b=SHJy545+2AbYYe45PxHtb3r+DjfG6jDAVswGmaPIlR5vD1RqwLqVNWafWOF/BNT32F kuwTqnsmP69G/1sMlLBaiFaAKTKvR84gm+ZJnuGeVwDFsuiMEfWSepe1tRU2qjukfXxd cpEnx/78SsQ73whdFQuVuzbDmXbB9oAnyQt7EsuydRfXi+ZIV+3vEs9y5fCGpkDrwVAi p5xY7tE5/h5YFPCK1QNXAi9WSJRR6IpPVgDQRQW1lxSMpoBrPRV/jgq/Wx2LjMltWMBl MywZ2jkOdiqXzXpt77x2a3jrpvmaZDtraOSRYLbBx+R1+y0LVEZm0Ej7xjkP617N8+nA M92g== X-Gm-Message-State: AG10YORbpXtBLKYgR1iF4v7pSP8B/7VYXbQICOU3kEtANT4sK1BL2OU+ZuRx/KMOZtGjSw== X-Received: by 10.25.79.16 with SMTP id d16mr11149910lfb.73.1456296282261; Tue, 23 Feb 2016 22:44:42 -0800 (PST) Received: from vostro.util.wtbts.net ([2001:1bc8:101:f402:21a:9fff:fe0c:4022]) by smtp.gmail.com with ESMTPSA id rx1sm172277lbb.22.2016.02.23.22.44.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 22:44:41 -0800 (PST) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Wed, 24 Feb 2016 08:44:37 +0200 From: Timo Teras To: Marc Vertes Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] testing/mongodb: fix for #5117 Message-ID: <20160224084437.2b11cbe1@vostro.util.wtbts.net> In-Reply-To: <2309A9D8-2394-4092-8BF5-BA4E3C13870F@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> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 23 Feb 2016 23:46:39 +0100 Marc Vertes wrote: > > 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. Should we start by applying that one? At least to make mongdb compile again as my change broke the build (bad checksums). > 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. Urgh. Yeah, that looks abhorrent. I'll ping #musl what could be done. > The 2 last remaining options: test if g++ -fsplit-stack would work, > or reduce quota as mentioned before. >=20 > What do you think ? 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). 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. 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. Thanks, Timo --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---