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: 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.

-- 


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