This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Implementation of some string.h function using SSE2 instructions
- From: John Reiser <jreiser at BitWagon dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 09 Aug 2007 06:36:25 -0700
- Subject: Re: Implementation of some string.h function using SSE2 instructions
PaweÅ Sikora <pluto@agmk.net> wrote:
> __m128i m1 = *( __m128i* )( s1 );
SIGSEGV will occur when the input strings are within 15 bytes below
an address-space boundary, such as the high end of user address space.
For instance, this value is often 0xc0000000 for Linux x86 (other
values are possible) and there is an interesting string that ends
there: the pathname that was given to execve(). The boundary between
an mmap() region and a non-existing page is also a problem.
Perhaps the code must defend against the last 15 bytes on any page.
Even if some convention or rule should prevent SIGSEGV from happening,
the code must contain a comment about this situation. Many existing
optimized versions of str*() routines require only 3-byte exclusions
at such boundaries.
--