Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170307214540.GU1520@brightrain.aerifal.cx>
Date: Tue, 7 Mar 2017 16:45:40 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: musl segfaulting when compiled with -O2

On Tue, Mar 07, 2017 at 05:55:29PM -0300, Breno Leitao wrote:
> Hi Rich,
> 
> On Tue, Mar 07, 2017 at 03:39:05PM -0500, Rich Felker wrote:
> > On Tue, Mar 07, 2017 at 05:32:35PM -0300, Breno Leitao wrote:
> > > Musl package on Debian on ppc64le is broken.
> > > 
> > > When running any software with it, it segfaults. Doing a little bit of
> > > debugging I found that libc.so is broken.
> > > 
> > > I got the upstream code, and found that the problme is also
> > > reproducible.
> > > 
> > > I found that the problem only happen when compiling with -O2 and -O3. If
> > > I compile musl with -O1 or -O0, the problm does not happen.
> > > 
> > > This is the bt of the code that crashes:
> > > 
> > > (gdb) bt
> > > #0  0x0000000148b84dc0 in ?? ()
> > > #1  0x0000000048bdb8dc in _dlstart_c (sp=0x3fffc33294b0, dynv=<optimized out>) at ldso/dlstart.c:147
> > > #2  0x0000000048bdebe0 in _dlstart ()
> > > 
> > > (gdb) up
> > > #1  0x0000000048bdb8dc in _dlstart_c (sp=0x3fffc33294b0, dynv=<optimized out>) at ldso/dlstart.c:147
> > > 147		dls2((void *)base, sp);
> > > 
> > > $ gcc --version
> > > gcc (Debian 6.3.0-5) 6.3.0 20170124
> > > 
> > > Not sure if this is a GCC issue or a musl issue now.
> > 
> > Can you post the crashing libc.so somewhere? Depending on how they're
> > building it, the problem could be in various different places. A
> > glibc-targeted powerpc* gcc is not suitable for compiling musl, since
> > it has various ABI mismatches, but that's probably not what you're
> > seeing here even if one was used.
> 
> Sure. You can grab it directly from Debian:
> 
>   $ wget http://cdn-fastly.deb.debian.org/debian/pool/main/m/musl/musl_1.1.16-2_ppc64el.deb
> 
>   $ dpkg-deb -x musl_1.1.16-2_ppc64el.deb .
> 
>   $ lib/powerpc64le-linux-musl/libc.so 
> [2]    25672 segmentation fault (core dumped) lib/powerpc64le-linux-musl/libc.so

Can you do a register dump and a dissassembly dump and around the
point that crashes? The Debian package is fully stripped (lacks debug
symbols) so it's hard to follow what it's doing, but I didn't see
anything obviously wrong.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.