From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13152 Path: news.gmane.org!.POSTED!not-for-mail From: "A. Wilcox" Newsgroups: gmane.linux.lib.musl.general Subject: Re: pthread_setattr_default_np behavior difference from glibc Date: Thu, 30 Aug 2018 13:13:19 -0500 Organization: =?UTF-8?Q?Ad=c3=a9lie_Linux?= Message-ID: References: <20170812053853.GA10413@dora.lan> <20180726155154.GA29079@brightrain.aerifal.cx> <20180726220747.GY1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q6I8HUq5ZuNqoZvapRETGMBFlBFpc9ctB" X-Trace: blaine.gmane.org 1535652583 19788 195.159.176.226 (30 Aug 2018 18:09:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2018 18:09:43 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux ppc64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: musl@lists.openwall.com Original-X-From: musl-return-13168-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 30 20:09:39 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fvRNz-00053c-FO for gllmg-musl@m.gmane.org; Thu, 30 Aug 2018 20:09:39 +0200 Original-Received: (qmail 27778 invoked by uid 550); 30 Aug 2018 18:11:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 27750 invoked from network); 30 Aug 2018 18:11:46 -0000 Openpgp: preference=signencrypt In-Reply-To: <20180726220747.GY1392@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13152 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Q6I8HUq5ZuNqoZvapRETGMBFlBFpc9ctB Content-Type: multipart/mixed; boundary="J2Fh2LXDn8ZmtBwXe7xXHws3AZE5e0k6h"; protected-headers="v1" From: "A. Wilcox" To: musl@lists.openwall.com Message-ID: Subject: Re: [musl] pthread_setattr_default_np behavior difference from glibc References: <20170812053853.GA10413@dora.lan> <20180726155154.GA29079@brightrain.aerifal.cx> <20180726220747.GY1392@brightrain.aerifal.cx> In-Reply-To: <20180726220747.GY1392@brightrain.aerifal.cx> --J2Fh2LXDn8ZmtBwXe7xXHws3AZE5e0k6h Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/26/18 17:07, Rich Felker wrote: > There's a PT_GNU_STACK ELF program header that's normally only used to > request non-executable stack, but it can also specify a stack size the > program wants. This is used (and was historically required) for > FDPIC/NOMMU targets to tell the kernel how much stack to reserve for > the main thread, and is conventionally left at 0/default for normal > ELF, but ld is capable of writing a custom size with > -Wl,-z,stacksize=3DX. >=20 > So, we could automatically increase __default_stacksize according to > max(current,dso.pt_gnu_stacksize.p_memsz) for the main program and > each loaded dso. This would make it possible to work around programs > that need large stacks but don't explicitly request them without > patching, by instead just adding the appropriate LDFLAGS. >=20 > Are there any significant cons to doing this? Would it help > distros/integrators? >=20 > Rich Short answer: YES! Long answer: One of the stickiest issues we've (Ad=C3=A9lie) had with the default thre= ad stack size on musl is not really patching programs (that's easy, and most upstreams actually do appreciate the conformance help). It's Mozilla products. There is no single place where a thread is spawned in Gecko / XPCOM / MozJS. It's a mess to try and fix it, so we haven't. And that means that pages that use very deeply nested JavaScript... some examples, off the top of my head: - AT&T's landing pages - Blue Cross of Oklahoma - Forbes (magazine) - Google Maps - Namecheap's domain renewal page =2E.. crash the browser because they exceeded the thread stack size. Being able to simply add a linker flag that would "magically" fix this for Firefox would be a huge win for us. Best, --arw --=20 A. Wilcox (awilfox) Project Lead, Ad=C3=A9lie Linux http://adelielinux.org --J2Fh2LXDn8ZmtBwXe7xXHws3AZE5e0k6h-- --Q6I8HUq5ZuNqoZvapRETGMBFlBFpc9ctB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjNyWOYPU1SaTSMHHyynLUZIrnRQFAluIM78ACgkQyynLUZIr nRRnmw/+KItdTxHHYUsZf/FXP97KkjFLapneCsK755gjmlZbm6nMnBkySK2qYnZw wZkPjf/71K9zaBrU7GDPpqGBM9+BJAWtQxG/0cabxHi143c8c8pue8exBO2+HOom nME/a+OTbPiuDtgGAIs7a2GS/YWmE00C3GWcPkhsn6gfh4kpb5gEIDBUSYqZrtkd j1kjTF69DVQG40l+xZmOmHAPT6VugGsAjD/VL4k+86MrNBJrmjNdx75pJOQNDVVZ k3SgQ0NBtwNVQEbzVgd6opeWN4hGNXEVSIZKzQO1OrKje1ff1aay6qsYunUG7cyV A84Nmw9TKRUT6WhLCzBePVOGTmmURS9uoavlcgBIa2pXhBiqZ+zJXlFX+pWwNZoU iMKoZuvH2DBas5jVtLHFzXNhj+wQJ2NL/Ike/ab+R8NpPckI04WMNDchjhjOBB1t 2QghA7OU8wpp502ztn2a6qPzFlh6rU22WrZv2pgKA3fv5bxn1CrMz65/jSfwfb3Q 14I6RuUAYmpZJLmh/3ucC5DP9WWN9U8Up709CEfULoxgs/ZAfuWuhmC1TxRUrl2X NacFtrsLz2nxyON8cI2sReTNBN2S2xfyLUPoiod/Db/vU/XSLJh1oW2YF6eqEKBh WHzhfDSfd4yYL2bleLq0FrA0DQM6JicOcaMU1Sg/j8JYKILIYIk= =ZKsu -----END PGP SIGNATURE----- --Q6I8HUq5ZuNqoZvapRETGMBFlBFpc9ctB--