public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/18773] New: [Regression] x86-64 strlen reads beyond the end of string
@ 2015-08-05 12:56 hjl.tools at gmail dot com
  2015-08-05 13:50 ` [Bug libc/18773] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2015-08-05 12:56 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18773

            Bug ID: 18773
           Summary: [Regression] x86-64 strlen reads beyond the end of
                    string
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: drepper.fsp at gmail dot com, neleai at seznam dot cz
  Target Milestone: ---

commit 37bb363f03d75e5e6f2ca45f2c686a3a0167797e
Author: Ondrej Bilka <neleai@seznam.cz>
Date:   Mon Mar 18 07:39:12 2013 +0100

    Faster strlen on x64. 

introduced strlen which reads beyond the end of string:

(gdb) disass
Dump of assembler code for function strlen:
   0x00007ffff6bdcaf0 <+0>:     pxor   %xmm0,%xmm0
   0x00007ffff6bdcaf4 <+4>:     pxor   %xmm1,%xmm1
   0x00007ffff6bdcaf8 <+8>:     pxor   %xmm2,%xmm2
   0x00007ffff6bdcafc <+12>:    pxor   %xmm3,%xmm3
   0x00007ffff6bdcb00 <+16>:    mov    %rdi,%rax
   0x00007ffff6bdcb03 <+19>:    mov    %rdi,%rcx
   0x00007ffff6bdcb06 <+22>:    and    $0xfff,%rcx
   0x00007ffff6bdcb0d <+29>:    cmp    $0xfcf,%rcx
   0x00007ffff6bdcb14 <+36>:    ja     0x7ffff6bdcb80 <strlen+144>
=> 0x00007ffff6bdcb16 <+38>:    movdqu (%rax),%xmm4
...
(gdb) p/x $rax
$2 = 0x1555555eceff

We can use movdqu here only if $rax - 16 within a page.  I will come up
with a run-time testcase later.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/18773] [Regression] x86-64 strlen reads beyond the end of string
  2015-08-05 12:56 [Bug libc/18773] New: [Regression] x86-64 strlen reads beyond the end of string hjl.tools at gmail dot com
@ 2015-08-05 13:50 ` cvs-commit at gcc dot gnu.org
  2015-08-05 15:03 ` hjl.tools at gmail dot com
  2015-08-05 15:07 ` cvs-commit at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-05 13:50 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18773

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr18773 has been created
        at  b436080ecfbefeaf3d614a27dfd687f6ca56e64c (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b436080ecfbefeaf3d614a27dfd687f6ca56e64c

commit b436080ecfbefeaf3d614a27dfd687f6ca56e64c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Aug 5 06:49:44 2015 -0700

    PR 18773 test

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/18773] [Regression] x86-64 strlen reads beyond the end of string
  2015-08-05 12:56 [Bug libc/18773] New: [Regression] x86-64 strlen reads beyond the end of string hjl.tools at gmail dot com
  2015-08-05 13:50 ` [Bug libc/18773] " cvs-commit at gcc dot gnu.org
@ 2015-08-05 15:03 ` hjl.tools at gmail dot com
  2015-08-05 15:07 ` cvs-commit at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2015-08-05 15:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18773

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Never mind.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/18773] [Regression] x86-64 strlen reads beyond the end of string
  2015-08-05 12:56 [Bug libc/18773] New: [Regression] x86-64 strlen reads beyond the end of string hjl.tools at gmail dot com
  2015-08-05 13:50 ` [Bug libc/18773] " cvs-commit at gcc dot gnu.org
  2015-08-05 15:03 ` hjl.tools at gmail dot com
@ 2015-08-05 15:07 ` cvs-commit at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-05 15:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18773

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr18773 has been deleted
       was  b436080ecfbefeaf3d614a27dfd687f6ca56e64c

- Log -----------------------------------------------------------------
b436080ecfbefeaf3d614a27dfd687f6ca56e64c PR 18773 test
-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-05 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-05 12:56 [Bug libc/18773] New: [Regression] x86-64 strlen reads beyond the end of string hjl.tools at gmail dot com
2015-08-05 13:50 ` [Bug libc/18773] " cvs-commit at gcc dot gnu.org
2015-08-05 15:03 ` hjl.tools at gmail dot com
2015-08-05 15:07 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).