From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13057 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Segmentation fault in static binaries built with recent binutils Date: Wed, 18 Jul 2018 13:37:55 -0400 Message-ID: <20180718173755.GP1392@brightrain.aerifal.cx> References: <20180718163940.gnx6jkia4i5qdjua@reiner-h.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1531935369 11917 195.159.176.226 (18 Jul 2018 17:36:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2018 17:36:09 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13073-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 18 19:36:05 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 1ffqMq-0002u3-FQ for gllmg-musl@m.gmane.org; Wed, 18 Jul 2018 19:36:00 +0200 Original-Received: (qmail 13329 invoked by uid 550); 18 Jul 2018 17:38:08 -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 12285 invoked from network); 18 Jul 2018 17:38:08 -0000 Content-Disposition: inline In-Reply-To: <20180718163940.gnx6jkia4i5qdjua@reiner-h.de> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13057 Archived-At: On Wed, Jul 18, 2018 at 06:39:40PM +0200, Reiner Herrmann wrote: > Hi, > > Debian recently updated binutils from 2.30 to 2.31. > When compiling simple static binaries with musl (1.19 and git) > they segfault on startup (dynamic linking still works fine). > With the previous binutils version it is running successfully. > > $ cat test.c > int main() { return 0; } > $ musl-gcc -ggdb3 -O0 -static test.c > $ gdb ./a.out > GNU gdb (Debian 8.1-3) 8.1 > [...] > Reading symbols from ./a.out...done. > (gdb) run > Starting program: /tmp/test/a.out > > Program received signal SIGSEGV, Segmentation fault. > 0x000000000040159d in static_init_tls () > (gdb) bt > #0 0x000000000040159d in static_init_tls () > #1 0x0000000000000000 in ?? () > > See also: https://ci.debian.net/packages/m/musl/unstable/amd64/ > > Is this a bug in musl or should I report it to binutils? Can you attach a readelf -a of the binary that's crashing? Rich