Bug 282979 - strcasestr needs replacement with recent(>=2.12) glibc
Summary: strcasestr needs replacement with recent(>=2.12) glibc
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.6 SVN
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 17:24 UTC by pavelo
Modified: 2011-10-21 08:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pavelo 2011-09-28 17:24:29 UTC
Version:           3.6 SVN
OS:                Linux

The usual problem... hyperoptimised functions produce errors when run it memcheck. The issue has been reported already (e.g here <http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg913684.html>, a patch is also available there), but as far as i can tell a fix hasn't been committed.

Reproducible: Always

Steps to Reproduce:
$ cat >foo.c <<'EOF'
  #define _GNU_SOURCE
  #include <string.h>

  int main(void)
  {
    char buf[32];

    strcpy(buf, "foo");
    return strcasestr(buf, "bar") != buf;
  }
  EOF

  $ gcc -o foo foo.c
  $ valgrind ./foo



Actual Results:  
  ==27953== Conditional jump or move depends on uninitialised value(s)
  ==27953==    at 0x4B34E2D: __strcasestr_sse42 (strstr.c:218)
  ==27953==    by 0x400519: main (in /home/peff/foo/valgrind/foo)

Expected Results:  
no errors
Comment 1 Tom Hughes 2011-09-28 18:26:37 UTC

*** This bug has been marked as a duplicate of bug 256600 ***
Comment 2 Tom Hughes 2011-09-28 18:28:00 UTC
Oops sorry, misread the function name.
Comment 3 Julian Seward 2011-10-21 08:12:35 UTC
Fixed, along with test case, r12187.  Thanks.