From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12381 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: seg fault at src/string/strlen.c:15 Date: Tue, 23 Jan 2018 21:27:43 -0500 Message-ID: <20180124022743.GX1627@brightrain.aerifal.cx> References: 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 1516760787 28966 195.159.176.226 (24 Jan 2018 02:26:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Jan 2018 02:26:27 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12397-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 24 03:26:23 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 1eeAlA-0005jz-JC for gllmg-musl@m.gmane.org; Wed, 24 Jan 2018 03:25:56 +0100 Original-Received: (qmail 19975 invoked by uid 550); 24 Jan 2018 02:27:56 -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 19950 invoked from network); 24 Jan 2018 02:27:55 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12381 Archived-At: On Tue, Jan 23, 2018 at 05:07:32PM -0800, Po-yi Wang wrote: > hi > > I try to compile make-4.1 for i486,ppc,arm targets. > i486 seem ok. "make --version" runs and no problem. > for ppc and arm targets, both seg fault at exactly the same place. > I had to recompile musl-1.1.18 for both with "-g3" to narrow down > the problem. it should be easy to reproduce. here is some outputs: > > [ppc][1] cd /build/make-4.1; file make > make: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 > (SYSV), statically linked, not stripped > [ppc][1] cd /build/make-4.1; cp make make-4.1 [ppc][1] cd > /build/make-4.1; gdb make-4.1 > GNU gdb 6.5 > Copyright (C) 2006 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and > you are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. > This GDB was configured as "powerpc-unknown-linux-gnu"...Using host > libthread_db library "/lib/libthread_db.so.1". > > (gdb) run --version > Starting program: /tmp/build/make-4.1/make-4.1 --version > > Program received signal SIGSEGV, Segmentation fault. > strlen (s=0x0) at src/string/strlen.c:15 > 15 for (w = (const void *)s; !HASZERO(*w); w++); > (gdb) This means make is calling strlen(0), so the bug is somewhere else -- in whatever causing the string pointer passed to strlen to be a null pointer. Can you show a full backtrace (bt) rather than just the point of the crash? > output for arm target: > > GNU gdb (GDB) 8.0 > Copyright (C) 2017 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "armv7l-unknown-linux-gnueabi". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from make-4.1...done. > (gdb) run --version > Starting program: /tmp/build/make-4.1/make-4.1 --version > > Program received signal SIGSEGV, Segmentation fault. > 0x0002c3a0 in strlen (s=, s@entry=0x0) at > src/string/strlen.c:15 > 15 for (w = (const void *)s; !HASZERO(*w); w++); > (gdb) Same here. Does the problem also happen with make 4.2? Alpine Linux is using make 4.2.1 I think and I haven't heard of such a problem from them. Rich