Hi Rainer,
> While the program is memcheck-clean, I get lots of violations and have
> not yet managed to find any failure in my code (what obviously does
> not mean there are none;)). It looks like some machine instructions
> used by glibc trigger these violations. Many are inside the
> string-library (like strcmp()) and show sizes of 8 or 16. To me, it
> almost looks like the string library is using extended load operations
> which then cause this problem.
>
>
Lots of string-related methods in glibc (like strchr) may be optimized, and
for example will not read the bytes in the string one by one, but in chunks
equal to the register size in the CPU, 64bits in your case.
In other words, strchr() may be reading your string in chunks of 8 bytes,
and will read some uninitialized data at the end of the string if the length
of the string is not multiple of 8. For example, in a string of 3 bytes you
may get 5 bytes reported as invalid read because strchr will actually try to
read 8 bytes at a time (even if then only uses the first 3 bytes in its
computation).
Cheers,
-Aleksander
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users