On 01/04/2014 09:54 PM, Niels Möller wrote:
0x6333d0, 0x6333d8 (src1) 0x6333f0, 0x6333f8 (src2) The reads at 0x6333d8 and 0x6333f8 include one byte beyond the end of the input areas, and one of them triggers a valgrind warning.
[...]
- There's no bug here.
I couldn't deduce that from your description. Why are these reads legal?
- We should use the --partial-loads-ok=yes valgrind option. (The manual says "Note that code that behaves in this way is in violation of the the ISO C/C++ standards, and should be considered broken.", but those standards clearly don't apply to assembly code).
- memxor.c might also use "partial loads" in a way which violates C standards. I don't think that's a problem on any real system, and, e.g, glibc memcmp does similar tricks.
Irrespective of the C standard, why do you think that accessing this byte outside the buffer boundary is valid? I guess you rely that pages will be of an aligned size anyway?
regards, Nikos