This is the mail archive of the glibc-bugs@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]

[Bug libc/12159] New: strchr (x86-64/multiarch/SSE4.2) handles second parameter incorrectly.


http://sourceware.org/bugzilla/show_bug.cgi?id=12159

           Summary: strchr (x86-64/multiarch/SSE4.2) handles second
                    parameter incorrectly.
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: richardpku@gmail.com


sysdeps/x86-64/multiarch/strchr.S (Both glibc-2.12.1 and latest git version):

If %rdi is aligned to a 16-byte boundary, the value of %xmm1 is not properly
set. The following program exposes this problem:


#include <stdio.h>
#include <string.h>
int main ()
{
    char s[] __attribute__((aligned(16))) = "\xff";
    printf ("%p\n", strchr (s, '\xfe'));
    return 0;
}


It is expected to output "(nil)", but it actually prints a valid pointer if run
on an x86-64 system with a multiarch-enabled glibc and a CPU which supports
SSE4.2.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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