From: Mark Wielaard Date: Thu, 18 Feb 2016 11:14:47 +0000 (+0000) Subject: Bug 359201 followup. futex skips argument 5 if op is FUTEX_WAIT_BITSET. X-Git-Tag: svn/VALGRIND_3_12_0~228 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54794decc89e47edab385196ffa9301218a36407;p=thirdparty%2Fvalgrind.git Bug 359201 followup. futex skips argument 5 if op is FUTEX_WAIT_BITSET. The original fix in svn r15793 read argument 6 separately by using PRA6 unconditionally. This is wrong. We need to first check whether a track_pre_reg_read callback is registered (only memcheck does). The PRE_REG_READX macro already had this check. Just add the same before calling PRA6. Thanks to Tom Hughes for noticing. Without this helgrind/tests/cond_timedwait_test and drd/tests/pth_inconsistent_cond_wait regtests would fail. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15795 --- diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index b57436cdae..f2d1076431 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -1163,7 +1163,8 @@ PRE(sys_futex) PRE_REG_READ4(long, "futex", vki_u32 *, futex, int, op, int, val, struct timespec *, utime); - PRA6("futex",int,val3); + if (VG_(tdict).track_pre_reg_read) + PRA6("futex",int,val3); } break; case VKI_FUTEX_WAKE_BITSET: