I'm running valgrind on a sigma designs smp8674b (mips32r2), using 16K pages. I've found that the mmap2() wrapper multiplies the mmap() offset argument by page size, however this argument is meant to be in units of 4096 bytes. am_do_mmap_NO_NOTIFY() expects this. The result is that calls to mmap2() don't pass through the correct offset argument, resulting (depending on the use case) either in the call failing, or doing the wrong thing. Patch attached to sort the problem out. Reproducible: Always
Created attachment 94363 [details] interpret offset argument as units of 4096 bytes
The patch has been committed as r16026. Thank you.
This issue can be closed now.
Petar: Duncan: the patch fixes only the mips32 case. Is the mips64 path correct, or does that also need to be fixed?
(In reply to Julian Seward from comment #4) > Petar: Duncan: the patch fixes only the mips32 case. Is the mips64 path > correct, or does that also need to be fixed? There is no path for mmap2() for MIPS64. That syscall is not supported on MIPS64, as there is no need for it since the offset is already 64-bit.