You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(2) |
2
(2) |
3
|
4
(1) |
|
5
(2) |
6
|
7
(1) |
8
(1) |
9
(3) |
10
(4) |
11
(3) |
|
12
|
13
(1) |
14
|
15
(1) |
16
|
17
|
18
|
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
|
29
|
30
|
31
(1) |
|
|
From: Paul F. <pa...@so...> - 2021-12-01 23:27:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=53ad200bfa6cdab92d6f471c9d6b2811a79335fc commit 53ad200bfa6cdab92d6f471c9d6b2811a79335fc Author: Paul Floyd <pj...@wa...> Date: Thu Dec 2 00:25:20 2021 +0100 Bug 446281 Add a DRD suppression for fwrite Add a suppression for fwrite-like functions. Helgrind already has a similar suppression. Diff: --- NEWS | 3 +++ glibc-2.X-drd.supp.in | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 76e598fb7f..e7b53a515c 100644 --- a/NEWS +++ b/NEWS @@ -54,6 +54,9 @@ are not entered into bugzilla tend to get forgotten about or ignored. 445354 arm64 backend: incorrect code emitted for doubleword CAS 445415 arm64 front end: alignment checks missing for atomic instructions 445668 Inline stack frame generation is broken for Rust binaries +446139 DRD/Helgrind with std::shared_timed_mutex::try_lock_until and try_lock_shared_until false positives +446138 DRD/Helgrind with std::timed_mutex::try_lock_until false positives +446281 Add a DRD suppression for fwrite To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/glibc-2.X-drd.supp.in b/glibc-2.X-drd.supp.in index 9a9b6f0752..b8c8ac0ad5 100644 --- a/glibc-2.X-drd.supp.in +++ b/glibc-2.X-drd.supp.in @@ -37,6 +37,13 @@ fun:random_r fun:random } +{ + drd-glibc-io-xsputn-mempcpy + drd:ConflictingAccess + fun:__GI_mempcpy + fun:_IO_*xsputn* + obj:@GLIBC_LIBC_PATH@ +} # # Suppression patterns for libstdc++, the implementation of the standard C++ |
|
From: Paul F. <pa...@so...> - 2021-12-01 23:16:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c2607e093c54abe473b1d419cbdbba403cc87cdf commit c2607e093c54abe473b1d419cbdbba403cc87cdf Author: Paul Floyd <pj...@wa...> Date: Thu Dec 2 00:03:27 2021 +0100 Bug 446139 DRD/Helgrind with std::shared_timed_mutex::try_lock_until and try_lock_shared_until false positives also Bug 446138 DRD/Helgrind with std::timed_mutex::try_lock_until false positives Diff: --- .gitignore | 2 + configure.ac | 46 +++++++++++ drd/drd_pthread_intercepts.c | 63 +++++++++++++++ drd/tests/Makefile.am | 19 +++++ drd/tests/shared_timed_mutex.cpp | 63 +++++++++++++++ drd/tests/shared_timed_mutex.stderr.exp | 3 + drd/tests/shared_timed_mutex.vgtest | 3 + drd/tests/timed_mutex.cpp | 29 +++++++ drd/tests/timed_mutex.stderr.exp | 3 + drd/tests/timed_mutex.vgtest | 3 + helgrind/hg_intercepts.c | 132 ++++++++++++++++++++++++++++++++ 11 files changed, 366 insertions(+) diff --git a/.gitignore b/.gitignore index fd85516b28..bf83c0f8c0 100644 --- a/.gitignore +++ b/.gitignore @@ -442,6 +442,7 @@ /drd/tests/sem_as_mutex /drd/tests/sem_open /drd/tests/sem_wait +/drd/tests/shared_timed_mutex /drd/tests/sigalrm /drd/tests/std_atomic /drd/tests/std_list @@ -476,6 +477,7 @@ /drd/tests/threaded-fork /drd/tests/thread_name /drd/tests/thread_name_freebsd +/drd/tests/timed_mutex /drd/tests/trylock /drd/tests/tsan_unittest /drd/tests/unit_bitmap diff --git a/configure.ac b/configure.ac index 4623d12b5b..96df114bae 100755 --- a/configure.ac +++ b/configure.ac @@ -2011,6 +2011,52 @@ AC_LANG(C) AM_CONDITIONAL(CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER, test x$ac_cxx_can_include_condition_variable_header = xyes) +# check for std::shared_timed_mutex, this is a C++ 14 feature + +AC_MSG_CHECKING([that C++ compiler can use std::shared_timed_mutex]) +AC_LANG(C++) +safe_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-std=c++1y -pthread" + +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#include <shared_mutex> +std::shared_timed_mutex test_mutex; +])], +[ +ac_cxx_can_use_shared_timed_mutex=yes +AC_MSG_RESULT([yes]) +], [ +ac_cxx_can_use_shared_timed_mutex=no +AC_MSG_RESULT([no]) +]) +CXXFLAGS=$safe_CXXFLAGS +AC_LANG(C) + +AM_CONDITIONAL(CXX_CAN_USE_SHARED_TIMED_MUTEX, test x$ac_cxx_can_use_shared_timed_mutex = xyes) + +# check for std::shared_mutex, this is a C++ 11 feature + +AC_MSG_CHECKING([that C++ compiler can use std::timed_mutex]) +AC_LANG(C++) +safe_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-std=c++0x -pthread" + +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#include <mutex> +std::timed_mutex test_mutex; +])], +[ +ac_cxx_can_use_timed_mutex=yes +AC_MSG_RESULT([yes]) +], [ +ac_cxx_can_use_timed_mutex=no +AC_MSG_RESULT([no]) +]) +CXXFLAGS=$safe_CXXFLAGS +AC_LANG(C) + +AM_CONDITIONAL(CXX_CAN_USE_TIMED_MUTEX, test x$ac_cxx_can_use_timed_mutex = xyes) + # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead # of the user_regs_struct from sys/user.h. They are structurally the same # but we get either one or the other. diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index 95127b42c6..c18e888678 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -1016,6 +1016,26 @@ PTH_FUNCS(int, (mutex, timeout)); #endif /* VGO_solaris */ +static __always_inline +int pthread_mutex_clocklock_intercept(pthread_mutex_t *mutex, + clockid_t clockid, + const struct timespec *abs_timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_MUTEX_LOCK, + mutex, DRD_(mutex_type)(mutex), 0, 0, 0); + CALL_FN_W_WWW(ret, fn, mutex, clockid, abs_timeout); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_MUTEX_LOCK, + mutex, ret == 0, 0, 0, 0); + return ret; +} + +PTH_FUNCS(int, pthreadZumutexZuclocklock, pthread_mutex_clocklock_intercept, + (pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abs_timeout), + (mutex, clockid, abs_timeout)); + static __always_inline int pthread_mutex_unlock_intercept(pthread_mutex_t *mutex) { @@ -1794,6 +1814,27 @@ PTH_FUNCS(int, pthreadZurwlockZureltimedrdlockZunp, (rwlock, timeout)); #endif /* VGO_solaris */ +static __always_inline +int pthread_rwlock_clockrdlock_intercept(pthread_rwlock_t* rwlock, + clockid_t clockid, + const struct timespec *timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_RWLOCK_RDLOCK, + rwlock, 0, 0, 0, 0); + CALL_FN_W_WWW(ret, fn, rwlock, clockid, timeout); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_RWLOCK_RDLOCK, + rwlock, ret == 0, 0, 0, 0); + return ret; +} + +PTH_FUNCS(int, + pthreadZurwlockZuclockrdlock, pthread_rwlock_clockrdlock_intercept, + (pthread_rwlock_t* rwlock, clockid_t clockid, const struct timespec *timeout), + (rwlock, clockid, timeout)); + static __always_inline int pthread_rwlock_timedwrlock_intercept(pthread_rwlock_t* rwlock, const struct timespec *timeout) @@ -1820,6 +1861,28 @@ PTH_FUNCS(int, pthreadZurwlockZureltimedwrlockZunp, (rwlock, timeout)); #endif /* VGO_solaris */ +static __always_inline +int pthread_rwlock_clockwrlock_intercept(pthread_rwlock_t* rwlock, + clockid_t clockid, + const struct timespec *timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_RWLOCK_WRLOCK, + rwlock, 0, 0, 0, 0); + CALL_FN_W_WWW(ret, fn, rwlock, clockid, timeout); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_RWLOCK_WRLOCK, + rwlock, ret == 0, 0, 0, 0); + return ret; +} + +PTH_FUNCS(int, + pthreadZurwlockZuclockwrlock, pthread_rwlock_clockwrlock_intercept, + (pthread_rwlock_t* rwlock, clockid_t clockid, const struct timespec *timeout), + (rwlock, clockid, timeout)); + + static __always_inline int pthread_rwlock_tryrdlock_intercept(pthread_rwlock_t* rwlock) { diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index ac487def3c..d7d73447bd 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -275,6 +275,8 @@ EXTRA_DIST = \ sem_open_traced.vgtest \ sem_wait.stderr.exp \ sem_wait.vgtest \ + shared_timed_mutex.stderr.exp \ + shared_timed_mutex.vgtest \ swapcontext.stderr.exp \ swapcontext.vgtest \ sigalrm.stderr.exp \ @@ -369,6 +371,8 @@ EXTRA_DIST = \ threaded-fork.vgtest \ threaded-fork-vcs.stderr.exp \ threaded-fork-vcs.vgtest \ + timed_mutex.stderr.exp \ + timed_mutex.vgtest \ tls_threads.stderr.exp \ tls_threads.vgtest \ trylock.stderr.exp \ @@ -468,6 +472,16 @@ check_PROGRAMS += \ condvar endif +if CXX_CAN_USE_SHARED_TIMED_MUTEX +check_PROGRAMS += \ + shared_timed_mutex +endif + +if CXX_CAN_USE_TIMED_MUTEX +check_PROGRAMS += \ + timed_mutex +endif + if HAVE_OPENMP check_PROGRAMS += omp_matinv omp_prime omp_printf endif @@ -593,6 +607,9 @@ if VGCONF_OS_IS_SOLARIS rwlock_test_CFLAGS += -D__EXTENSIONS__ endif +shared_timed_mutex_SOURCES = shared_timed_mutex.cpp +shared_timed_mutex_CXXFLAGS = $(AM_CXXFLAGS) -std=c++1y + std_atomic_SOURCES = std_atomic.cpp std_atomic_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x -Wno-sign-compare @@ -628,3 +645,5 @@ if VGCONF_OS_IS_SOLARIS swapcontext_CFLAGS += -D__EXTENSIONS__ endif +timed_mutex_SOURCES = timed_mutex.cpp +timed_mutex_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x diff --git a/drd/tests/shared_timed_mutex.cpp b/drd/tests/shared_timed_mutex.cpp new file mode 100644 index 0000000000..306d6bf27a --- /dev/null +++ b/drd/tests/shared_timed_mutex.cpp @@ -0,0 +1,63 @@ +#include <thread> +#include <iostream> +#include <chrono> +#include <shared_mutex> +#include <mutex> +#include <cassert> +#include <condition_variable> + +std::shared_timed_mutex test_mutex; +std::mutex cv_mutex; +std::condition_variable cv; +int global; +bool reads_done = false; + +void f() +{ + auto now=std::chrono::steady_clock::now(); + if (test_mutex.try_lock_until(now + std::chrono::seconds(3))) + { + --global; + test_mutex.unlock(); + } + else + { + std::cerr << "Lock failed\n"; + } +} + +void g() +{ + auto now=std::chrono::steady_clock::now(); + if (test_mutex.try_lock_shared_until(now + std::chrono::seconds(2))) + { + test_mutex.unlock_shared(); + } + else + { + std::cerr << "Lock shared failed\n"; + } + std::unique_lock<std::mutex> lock(cv_mutex); + reads_done = true; + cv.notify_all(); +} + +int main() +{ + global = 1; + test_mutex.lock_shared(); + std::thread t1(f); + std::thread t2(g); + { + std::unique_lock<std::mutex> lock(cv_mutex); + while (!reads_done) + { + cv.wait(lock); + } + } + test_mutex.unlock_shared(); + t1.join(); + t2.join(); + assert(global == 0); +} + diff --git a/drd/tests/shared_timed_mutex.stderr.exp b/drd/tests/shared_timed_mutex.stderr.exp new file mode 100644 index 0000000000..d18786f806 --- /dev/null +++ b/drd/tests/shared_timed_mutex.stderr.exp @@ -0,0 +1,3 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/shared_timed_mutex.vgtest b/drd/tests/shared_timed_mutex.vgtest new file mode 100644 index 0000000000..e3be8646c5 --- /dev/null +++ b/drd/tests/shared_timed_mutex.vgtest @@ -0,0 +1,3 @@ +prereq: ./supported_libpthread && [ -e shared_timed_mutex ] +vgopts: --check-stack-var=yes --read-var-info=yes +prog: shared_timed_mutex diff --git a/drd/tests/timed_mutex.cpp b/drd/tests/timed_mutex.cpp new file mode 100644 index 0000000000..b1bb61efa6 --- /dev/null +++ b/drd/tests/timed_mutex.cpp @@ -0,0 +1,29 @@ +#include <thread> +#include <iostream> +#include <chrono> +#include <mutex> +#include <cassert> + +std::timed_mutex test_mutex; +int global; + +void f() +{ + auto now=std::chrono::steady_clock::now(); + test_mutex.try_lock_until(now + std::chrono::seconds(11)); + --global; + test_mutex.unlock(); +} + +int main() +{ + global = 0; + auto now=std::chrono::steady_clock::now(); + test_mutex.try_lock_until(now + std::chrono::seconds(11)); + ++global; + std::thread t(f); + test_mutex.unlock(); + t.join(); + assert(global == 0); +} + diff --git a/drd/tests/timed_mutex.stderr.exp b/drd/tests/timed_mutex.stderr.exp new file mode 100644 index 0000000000..d18786f806 --- /dev/null +++ b/drd/tests/timed_mutex.stderr.exp @@ -0,0 +1,3 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/timed_mutex.vgtest b/drd/tests/timed_mutex.vgtest new file mode 100644 index 0000000000..60769b2d13 --- /dev/null +++ b/drd/tests/timed_mutex.vgtest @@ -0,0 +1,3 @@ +prereq: ./supported_libpthread && [ -e timed_mutex ] +vgopts: --check-stack-var=yes --read-var-info=yes +prog: timed_mutex diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 49c3ddcd9e..c9b3f85ef3 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -1110,6 +1110,53 @@ PTH_FUNC(int, pthreadZumutexZureltimedlock, // pthread_mutex_reltimedlock } #endif +//----------------------------------------------------------- +// glibc: pthread_mutex_clocklock +// +// pthread_mutex_clocklock. Identical logic to pthread_mutex_timedlock. +__attribute__((noinline)) +static int mutex_clocklock_WRK(pthread_mutex_t *mutex, + clockid_t clockid, + void *timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + if (TRACE_PTH_FNS) { + fprintf(stderr, "<< pthread_mxclocklock %p %p", mutex, timeout); + fflush(stderr); + } + + DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_PRE, + pthread_mutex_t*,mutex, long,1/*isTryLock-ish*/); + + CALL_FN_W_WWW(ret, fn, mutex, clockid, timeout); + + /* There's a hole here: libpthread now knows the lock is locked, + but the tool doesn't, so some other thread could run and detect + that the lock has been acquired by someone (this thread). Does + this matter? Not sure, but I don't think so. */ + + DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_POST, + pthread_mutex_t *, mutex, long, (ret == 0) ? True : False); + + if (ret != 0) { + if (ret != ETIMEDOUT) + DO_PthAPIerror( "pthread_mutex_clocklock", ret ); + } + + if (TRACE_PTH_FNS) { + fprintf(stderr, " :: mxclocklock -> %d >>\n", ret); + } + return ret; +} + +PTH_FUNC(int, pthreadZumutexZuclocklock, // pthread_mutex_clocklock + pthread_mutex_t *mutex, + clockid_t clockid, + void *timeout) { + return mutex_clocklock_WRK(mutex, clockid, timeout); +} //----------------------------------------------------------- // glibc: pthread_mutex_unlock @@ -2685,6 +2732,48 @@ PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock # error "Unsupported OS" #endif +//----------------------------------------------------------- +// glibc: pthread_rwlock_clockrdlock +// +__attribute__((noinline)) __attribute__((unused)) +static int pthread_rwlock_clockrdlock_WRK(pthread_rwlock_t *rwlock, + clockid_t clockid, + const struct timespec *timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + if (TRACE_PTH_FNS) { + fprintf(stderr, "<< pthread_rwl_clockrdl %p", rwlock); fflush(stderr); + } + + DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE, + pthread_rwlock_t *, rwlock, + long, 0/*isW*/, long, 0/*isTryLock*/); + + CALL_FN_W_WWW(ret, fn, rwlock, clockid, timeout); + + DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST, + pthread_rwlock_t *, rwlock, long, 0/*isW*/, + long, (ret == 0) ? True : False); + if (ret != 0) { + DO_PthAPIerror("pthread_rwlock_clockrdlock", ret); + } + + if (TRACE_PTH_FNS) { + fprintf(stderr, " :: rwl_clockrdl -> %d >>\n", ret); + } + return ret; +} +#if defined(VGO_linux) +PTH_FUNC(int, pthreadZurwlockZuclockrdlock, // pthread_rwlock_clockrdlock + pthread_rwlock_t *rwlock, + clockid_t clockid, + const struct timespec *timeout) { + return pthread_rwlock_clockrdlock_WRK(rwlock, clockid, timeout); +} +#endif + //----------------------------------------------------------- // glibc: Unhandled @@ -2746,6 +2835,49 @@ PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock #endif +//----------------------------------------------------------- +// glibc: pthread_rwlock_clockwrlock +// +__attribute__((noinline)) __attribute__((unused)) +static int pthread_rwlock_clockwrlock_WRK(pthread_rwlock_t *rwlock, + clockid_t clockid, + const struct timespec *timeout) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + if (TRACE_PTH_FNS) { + fprintf(stderr, "<< pthread_rwl_clockwrl %p", rwlock); fflush(stderr); + } + + DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE, + pthread_rwlock_t *, rwlock, + long, 1/*isW*/, long, 0/*isTryLock*/); + + CALL_FN_W_WWW(ret, fn, rwlock, clockid, timeout); + + DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST, + pthread_rwlock_t *, rwlock, long, 1/*isW*/, + long, (ret == 0) ? True : False); + if (ret != 0) { + DO_PthAPIerror("pthread_rwlock_clockwrlock", ret); + } + + if (TRACE_PTH_FNS) { + fprintf(stderr, " :: rwl_clockwrl -> %d >>\n", ret); + } + return ret; +} +#if defined(VGO_linux) +PTH_FUNC(int, pthreadZurwlockZuclockwrlock, // pthread_rwlock_clockwrlock + pthread_rwlock_t *rwlock, + clockid_t clockid, + const struct timespec *timeout) { + return pthread_rwlock_clockwrlock_WRK(rwlock, clockid, timeout); +} +#endif + + //----------------------------------------------------------- // glibc: pthread_rwlock_unlock // darwin: pthread_rwlock_unlock |