From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10696 Path: news.gmane.org!.POSTED!not-for-mail From: "LeMay, Michael" Newsgroups: gmane.linux.lib.musl.general Subject: Re: [RFC PATCH v2 2/4] support SafeStack in init and threading Date: Wed, 2 Nov 2016 14:50:15 -0700 Message-ID: <217e8254-8629-2a75-b717-43ebcc43ea6c@intel.com> References: <390CE752059EB848A71F4F676EBAB76D3AC2636A@ORSMSX114.amr.corp.intel.com> <20161101235219.GH5749@port70.net> <456a88bf-50bb-479d-11c5-bd82ce116e67@intel.com> <20161102174031.GI5749@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1478123469 7049 195.159.176.226 (2 Nov 2016 21:51:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2016 21:51:09 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 To: "musl@lists.openwall.com" Original-X-From: musl-return-10709-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 02 22:51:04 2016 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 1c23QU-00064B-Qu for gllmg-musl@m.gmane.org; Wed, 02 Nov 2016 22:50:30 +0100 Original-Received: (qmail 17951 invoked by uid 550); 2 Nov 2016 21:50:32 -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 17924 invoked from network); 2 Nov 2016 21:50:31 -0000 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,436,1473145200"; d="scan'208";a="186928705" In-Reply-To: <20161102174031.GI5749@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:10696 Archived-At: On 11/2/2016 10:40, Szabolcs Nagy wrote: > * LeMay, Michael [2016-11-02 09:56:14 -0700]: >> On 11/1/2016 16:52, Szabolcs Nagy wrote: >>> * LeMay, Michael [2016-10-28 20:00:24 +0000]: >> ... >>>> + if (pthread_getattr_np(self, &attr) != 0) >>>> + a_crash(); >>> this may have significant startup overhead because determining >>> the main stack size is not optimized. >> I could use a constant stack size here instead. However, this will be >> needed for supporting a separate stack segment, since it is used to >> determine the proper limit for the DS and ES segments. > ok > > the pthread_* symbol should be moved to the reserved > namespace (__pthread_*) since this code will get > static linked into iso c conforming code which is > allowed to redefine pthread_*. pthread_getattr_np and pthread_attr_getstack currently have strong definitions in musl. Are you proposing that I rename the existing definitions into the __pthread_* namespace and add weak aliases? By the way, I need to update my patch of __pthread_create to pass new->stack as the second parameter to __clone, since __safestack_init_thread updates that field.