This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Potential issue with strstr on x86 with sse4.2 in glibc-2.18
- From: Rich Felker <dalias at aerifal dot cx>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 19 Aug 2013 13:05:50 -0400
- Subject: Re: Potential issue with strstr on x86 with sse4.2 in glibc-2.18
- References: <520E181D dot 2040308 at archlinux dot org> <alpine dot LNX dot 2 dot 00 dot 1308191628370 dot 2626 at monopod dot intra dot ispras dot ru> <20130819144648 dot GF20515 at brightrain dot aerifal dot cx> <alpine dot LNX dot 2 dot 00 dot 1308191924490 dot 2626 at monopod dot intra dot ispras dot ru> <20130819163712 dot GG20515 at brightrain dot aerifal dot cx> <alpine dot LNX dot 2 dot 00 dot 1308192045480 dot 2626 at monopod dot intra dot ispras dot ru>
On Mon, Aug 19, 2013 at 08:49:27PM +0400, Alexander Monakov wrote:
> On Mon, 19 Aug 2013, Rich Felker wrote:
> > As far as I can tell, adding the inline keywords back is not a fix,
> > it's just a perturbation of gcc's behavior that happens to re-mask the
> > bug. It could really come back at any time depending on compiler
> > version, CFLAGS, etc.
>
> Do you mean a bug in glibc? Or a psABI bug? :)
The bug is in the mismatch between the (GCC-amended) psABI and the
libGL binary. Which one is at fault is a matter of opinion. :-)
> Do you assume 16-byte stack
> alignment in musl, or do you compile with options that prevent GCC from
> touching SSE registers on 32-bit x86?
Yes, by default, but just because the default is -march=i486. This is
not needed to avoid SSE alignment bugs, though, because GCC preserves
the stack alignment mod 16 anyway unless you override that behavior.
Rich