[Bug 1027977] Re: strstr() function produces wrong results under valgrind callgrind
Launchpad Bug Tracker
1027977 at bugs.launchpad.net
Sat Oct 6 00:45:18 UTC 2012
This bug was fixed in the package valgrind - 1:3.7.0-0ubuntu4
---------------
valgrind (1:3.7.0-0ubuntu4) quantal; urgency=low
* fix-buffer-overflows.patch: fix overflows in vgdb
* 05_fix-callgrind_control.patch: fix valgrind process name (LP: #1036283)
* fix-VEX-PCMPxSTRx.patch: fix strstr handling (LP: #1027977)
-- Julian Taylor <jtaylor at ubuntu.com> Fri, 05 Oct 2012 20:16:28 +0200
** Changed in: valgrind (Ubuntu)
Status: Confirmed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to valgrind in Ubuntu.
https://bugs.launchpad.net/bugs/1027977
Title:
strstr() function produces wrong results under valgrind callgrind
Status in Valgrind:
Fix Released
Status in “valgrind” package in Ubuntu:
Fix Released
Bug description:
$valgrind --version
valgrind-3.7.0
When an application that uses the strstr() function from the C standard library is profiled with valgrind --tool=callgrind, the strstr() function produces false results (at least) under the following conditions:
* the string s1 to search in and the string s2 to search for are exact duplicates, that is strcmp(s1,s2)==0. s1 and s2 don't need to be pointing to the same memory object.
* the string length (excluding terminating zero) is a multiple of 16
Expected result: strstr(s1,s2) returns s1, indicating a match at the first charactor of s1
What happens: strstr(s1,s2) returns NULL, indicating no matching substring was found.
See attached minimal testcase for an example. Reproduce under Ubuntu 12.04 with the following steps:
$gcc strstrtest.c -o strstrtest
$./ strstrtest # <-- should report no errors
$valgrind --tool=callgrind ./ strstrtest # <-- should report errors for lengths multiple of 16
- The Problem does not show up under valgrind-3.6.0.SVN-Debian from Ubuntu 10.04 Lucid Lynx
- The Problem does not show up under tool=memcheck.
Some more info:
OS: Ubuntu 12.04 Precise Pangolin
$uname -a
Linux mhassert 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
To manage notifications about this bug go to:
https://bugs.launchpad.net/valgrind/+bug/1027977/+subscriptions
More information about the foundations-bugs
mailing list