|
From: Petar J. <mip...@gm...> - 2012-07-18 10:54:05
|
Hi everyone,
V may have an issue with glibc for futex system call with
FUTEX_WAIT_BITSET. In short, glibc uses 5 parameters and V expects 6
parameters.
In more detail, in glibc, when syscall with FUTEX_WAIT_BITSET is invoked
(glibc/nptl/nptl-init.c), 5 parameters are given, and they comment this:
* /* NB: the syscall actually takes six parameters. The last is the
bit mask. But since we will not actually wait at all the value
is irrelevant. Given that passing six parameters is difficult
on some architectures we just pass whatever random value the
calling convention calls for to the kernel. It causes no harm. */
word = INTERNAL_SYSCALL (futex, err, 5, &word,
FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
| FUTEX_PRIVATE_FLAG, 1, NULL, 0);*
Now, "it causes no harm" may not be the case for Valgrind, as V sees 6th
parameter as an undefined value (well, for MIPS arch for sure). We handle
this in generic syscall wrapper in syswrap-linux.c as:
* case VKI_FUTEX_WAIT_BITSET:
PRE_REG_READ6(long, "futex",
vki_u32 *, futex, int, op, int, val,
struct timespec *, utime, int, dummy, int, val3);
break;*
So, V will report something like:
*"Syscall param futex(val3) contains uninitialised byte(s)"*
Anybody has a neat idea how to handle this situation?
Petar
|