From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8521 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: pthread_getattr_np() vs explicit runtime loader Date: Sun, 20 Sep 2015 12:34:05 -0400 Message-ID: <20150920163405.GK17773@brightrain.aerifal.cx> References: <20150920063909.GO12087@example.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1442766868 3623 80.91.229.3 (20 Sep 2015 16:34:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Sep 2015 16:34:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8533-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 20 18:34:22 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZdhZG-0003e7-6O for gllmg-musl@m.gmane.org; Sun, 20 Sep 2015 18:34:22 +0200 Original-Received: (qmail 3640 invoked by uid 550); 20 Sep 2015 16:34:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3616 invoked from network); 20 Sep 2015 16:34:18 -0000 Content-Disposition: inline In-Reply-To: <20150920063909.GO12087@example.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8521 Archived-At: On Sun, Sep 20, 2015 at 08:39:09AM +0200, u-wsnj@aetey.se wrote: > Hello, > > musl 1.1.8 on ia32 Linux, building gcc 5.2.0 succeeds. > > Nevertheless a subset of the resulting executables segfault when run by > an explicit loader (which is the vital mode of operation in our setups). > > They do not seem to segfault when using the implicit loader > which suggests the result depends on the memory mapping layout. > > Moreover, the last syscalls seen before the crash are mremap(), > presumably reflecting that pthread_getattr_np() is involved. > > It looks like (according to a discussion in mail archives) the logic > in this function makes assumptions which not necessarily are true while > using an explicit runtime loader. > > Would you comment on whether this guess is correct and hopefully make > pthread_getattr_np() work even with the explicit loader? I reviewed the code and there are no assumptions about how the program is loaded made there. And the original test program I used to test pthread_getattr_np runs fine both normally and with an explicit loader command. So I think the actual problem must be elsewhere, likely in whatever the application is doing right after pthread_getattr_np. What triggered the crash to start happening? Upgrading musl? Upgrading gcc? Have you used gdb to get a backtrace and see where the program actually crashes? Rich