This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Potential issue with strstr on x86 with sse4.2 in glibc-2.18


On Mon, Aug 19, 2013 at 04:35:35PM +0400, Alexander Monakov wrote:
> I've had a look and it appears that __strstr_sse42 is entered from fglrx's
> libGL.so.1 with misaligned stack (not divisible by 16), so spilling an SSE
> register to stack fails.  Shouldn't glibc realign stack for SSE-accelerated
> functions on x86?

In theory, from a standpoint of supporting old code, yes.

However, gcc is free to use sse in any function it wants, and adding
the gcc option to make the callee realign the stack in all functions
would probably be prohibitively expensive.

I think the gcc folks' changing of the psABI to require 16-byte
alignment was a mistake, and it should have been left alone, and
callees using sse should have been required to do their own
realignment. However this is deep in the past now, and we're stuck
with the bad decision that makes it impossible to support legacy
binaries without a global performance hit.

Really this doesn't even look like a case of a legacy binary, but
rather fglrx's libGL.so.1 simply containing incorrect asm (or just
CFLAGS?) that doesn't match the modern psABI calling convention. It
would probably be best to pressure its maintainers to fix this bug on
their side...

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]