From: Mark Wielaard Date: Wed, 17 Feb 2016 20:53:34 +0000 (+0000) Subject: Bug 359201 futex syscall skips argument 5 if op is FUTEX_WAIT_BITSET X-Git-Tag: svn/VALGRIND_3_12_0~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd541e9164d172f937bfc200e4c865d23c89785;p=thirdparty%2Fvalgrind.git Bug 359201 futex syscall skips argument 5 if op is FUTEX_WAIT_BITSET git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15793 --- diff --git a/NEWS b/NEWS index 542d62466e..ba4828f3ad 100644 --- a/NEWS +++ b/NEWS @@ -70,6 +70,7 @@ where XXXXXX is the bug number as listed below. 357871 pthread_spin_destroy not properly wrapped 357887 Fix a file handle leak. VG_(fclose) did not close the file 358030 support direct socket calls on x86 32bit (new in linux 4.3) +359201 futex syscall "skips" argument 5 if op is FUTEX_WAIT_BITSET 359133 Assertion 'eltSzB <= ddpa->poolSzB' failed 359289 s390x: popcnt (B9E1) not implemented diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index f796969898..b57436cdae 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -1154,13 +1154,16 @@ PRE(sys_futex) return; } if (*(vki_u32 *)ARG1 != ARG3) { - PRE_REG_READ5(long, "futex", + PRE_REG_READ4(long, "futex", vki_u32 *, futex, int, op, int, val, - struct timespec *, utime, int, dummy); + struct timespec *, utime); } else { - PRE_REG_READ6(long, "futex", + /* Note argument 5 is unused, but argument 6 is used. + So we cannot just PRE_REG_READ6. Read argument 6 separately. */ + PRE_REG_READ4(long, "futex", vki_u32 *, futex, int, op, int, val, - struct timespec *, utime, int, dummy, int, val3); + struct timespec *, utime); + PRA6("futex",int,val3); } break; case VKI_FUTEX_WAKE_BITSET: