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
(1) |
2
(3) |
3
|
4
|
5
|
6
|
|
7
|
8
(1) |
9
(3) |
10
(2) |
11
(2) |
12
(8) |
13
(5) |
|
14
(2) |
15
|
16
|
17
(4) |
18
(2) |
19
(2) |
20
(1) |
|
21
(2) |
22
(4) |
23
(6) |
24
(2) |
25
|
26
(3) |
27
(1) |
|
28
|
29
(1) |
30
(1) |
|
|
|
|
|
From: Mark W. <ma...@so...> - 2021-11-19 14:17:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8ad4c01880670b66d7b89fb0984bab2d26162ab8 commit 8ad4c01880670b66d7b89fb0984bab2d26162ab8 Author: Mark Wielaard <ma...@kl...> Date: Fri Nov 19 15:00:27 2021 +0100 memcheck/tests/libstdc++.supp: rename suppression The name malloc-leaks-cxx-stl-string-classes-debug was confusing since the suppression wasn't a leak, not part of stl, string, classes or debug. Rename it to libstdcxx-emergency-eh-alloc-pool to indicate it is part of the emergency exception handling memory pool. Note that suppression is only needed for some test cases, normally the pool is cleaned up as part of cxx_freeres. Diff: --- memcheck/tests/libstdc++.supp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/libstdc++.supp b/memcheck/tests/libstdc++.supp index 852d8ab0b6..2cac057305 100644 --- a/memcheck/tests/libstdc++.supp +++ b/memcheck/tests/libstdc++.supp @@ -69,7 +69,7 @@ fun:call_init* } { - malloc-leaks-cxx-stl-string-classes-debug + libstdcxx-emergency-eh-alloc-pool Memcheck:Leak match-leak-kinds: reachable fun:malloc |
|
From: Paul F. <pa...@so...> - 2021-11-19 07:36:18
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9abfed23c0d430aafb85de6397d171316c982792 commit 9abfed23c0d430aafb85de6397d171316c982792 Author: Paul Floyd <pj...@wa...> Date: Fri Nov 19 08:34:53 2021 +0100 Bug 445504 Using C++ condition_variable results in bogus "mutex is locked simultaneously by two threads" warning(edit) Add intercepts for pthread_cond_clockwait to DRD and Helgrind Also testcase from bugzilla done by Bart, with configure check Diff: --- .gitignore | 1 + configure.ac | 21 ++++++++++++ drd/drd_pthread_intercepts.c | 24 +++++++++++++ drd/tests/Makefile.am | 9 +++++ drd/tests/condvar.cpp | 55 +++++++++++++++++++++++++++++ drd/tests/condvar.stderr.exp | 5 +++ drd/tests/condvar.vgtest | 3 ++ helgrind/hg_intercepts.c | 82 ++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 200 insertions(+) diff --git a/.gitignore b/.gitignore index 5ab4d74ebe..57ba9ca92a 100644 --- a/.gitignore +++ b/.gitignore @@ -384,6 +384,7 @@ /drd/tests/bug322621 /drd/tests/circular_buffer /drd/tests/concurrent_close +/drd/tests/condvar /drd/tests/custom_alloc /drd/tests/dlopen_lib.so /drd/tests/dlopen_main diff --git a/configure.ac b/configure.ac index e7381f205d..cb836dbff5 100755 --- a/configure.ac +++ b/configure.ac @@ -1989,6 +1989,27 @@ AC_LANG(C) AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes) +# Check whether compiler can process #include <condition_variable> without errors + +AC_MSG_CHECKING([that C++ compiler can include <condition_variable> header file]) +AC_LANG(C++) +safe_CXXFLAGS=$CXXFLAGS +CXXFLAGS=-std=c++0x + +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#include <condition_variable> +])], +[ +ac_cxx_can_include_condition_variable_header=yes +AC_MSG_RESULT([yes]) +], [ +ac_cxx_can_include_condition_variable_header=no +AC_MSG_RESULT([no]) +]) +CXXFLAGS=$safe_CXXFLAGS +AC_LANG(C) + +AM_CONDITIONAL(CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER, test x$ac_cxx_can_include_condition_variable_header = 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 diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index 8b44543645..95127b42c6 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -1175,6 +1175,30 @@ PTH_FUNCS(int, condZureltimedwait, pthread_cond_timedwait_intercept, (cond, mutex, timeout)); #endif /* VGO_solaris */ + +static __always_inline +int pthread_cond_clockwait_intercept(pthread_cond_t *cond, + pthread_mutex_t *mutex, + clockid_t clockid, + const struct timespec* abstime) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_COND_WAIT, + cond, mutex, DRD_(mutex_type)(mutex), 0, 0); + CALL_FN_W_WWWW(ret, fn, cond, mutex, clockid, abstime); + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_COND_WAIT, + cond, mutex, 1, 0, 0); + return ret; +} + +PTH_FUNCS(int, pthreadZucondZuclockwait, pthread_cond_clockwait_intercept, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + clockid_t clockid, const struct timespec* abstime), + (cond, mutex, clockid, abstime)); + + // NOTE: be careful to intercept only pthread_cond_signal() and not Darwin's // pthread_cond_signal_thread_np(). The former accepts one argument; the latter // two. Intercepting all pthread_cond_signal* functions will cause only one diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 4cb2f7f84a..c804391e81 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -105,6 +105,8 @@ EXTRA_DIST = \ circular_buffer.vgtest \ concurrent_close.stderr.exp \ concurrent_close.vgtest \ + condvar.stderr.exp \ + condvar.vgtest \ custom_alloc.stderr.exp \ custom_alloc.vgtest \ custom_alloc_fiw.stderr.exp \ @@ -458,6 +460,11 @@ check_PROGRAMS += \ endif endif +if CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER +check_PROGRAMS += \ + condvar +endif + if HAVE_OPENMP check_PROGRAMS += omp_matinv omp_prime omp_printf endif @@ -502,6 +509,8 @@ LDADD = -lpthread bug322621_SOURCES = bug322621.cpp +condvar_SOURCES = condvar.cpp +condvar_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x concurrent_close_SOURCES = concurrent_close.cpp if !VGCONF_OS_IS_FREEBSD dlopen_main_LDADD = -ldl diff --git a/drd/tests/condvar.cpp b/drd/tests/condvar.cpp new file mode 100644 index 0000000000..18ecb3f8a4 --- /dev/null +++ b/drd/tests/condvar.cpp @@ -0,0 +1,55 @@ +/* See also https://bugs.kde.org/show_bug.cgi?id=445504 */ + +#include <condition_variable> +#include <future> +#include <iostream> +#include <mutex> +#include <thread> +#include <vector> + +using lock_guard = std::lock_guard<std::mutex>; +using unique_lock = std::unique_lock<std::mutex>; + +struct state { + std::mutex m; + std::vector<int> v; + std::condition_variable cv; + + state() { + // Call pthread_cond_init() explicitly to let DRD know about 'cv'. + pthread_cond_init(cv.native_handle(), NULL); + } +}; + +void other_thread(state *sp) { + state &s = *sp; + std::cerr << "Other thread: waiting for notify\n"; + unique_lock l{s.m}; + while (true) { + if (s.cv.wait_for(l, std::chrono::seconds(3)) != + std::cv_status::timeout) { + std::cerr << "Other thread: notified\n"; + break; + } + } + return; +} + + +int main() { + state s; + auto future = std::async(std::launch::async, other_thread, &s); + + if (future.wait_for(std::chrono::seconds(1)) != std::future_status::timeout) { + std::cerr << "Main: other thread returned too early!\n"; + return 2; + } + + { + std::lock_guard<std::mutex> g{s.m}; + s.v.push_back(1); + s.v.push_back(2); + s.cv.notify_all(); + } + return 0; +} diff --git a/drd/tests/condvar.stderr.exp b/drd/tests/condvar.stderr.exp new file mode 100644 index 0000000000..be1de9f973 --- /dev/null +++ b/drd/tests/condvar.stderr.exp @@ -0,0 +1,5 @@ + +Other thread: waiting for notify +Other thread: notified + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/condvar.vgtest b/drd/tests/condvar.vgtest new file mode 100644 index 0000000000..2e7d49f5a6 --- /dev/null +++ b/drd/tests/condvar.vgtest @@ -0,0 +1,3 @@ +prereq: ./supported_libpthread && [ -e condvar ] +vgopts: --check-stack-var=yes --read-var-info=yes +prog: condvar diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 866efdbaa8..49c3ddcd9e 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -1409,6 +1409,88 @@ static int pthread_cond_timedwait_WRK(pthread_cond_t* cond, # error "Unsupported OS" #endif +//----------------------------------------------------------- +// glibc: pthread_cond_clockwait +// +__attribute__((noinline)) +static int pthread_cond_clockwait_WRK(pthread_cond_t* cond, + pthread_mutex_t* mutex, + clockid_t clockid, + struct timespec* abstime, + int timeout_error) +{ + int ret; + OrigFn fn; + unsigned long mutex_is_valid; + Bool abstime_is_valid; + VALGRIND_GET_ORIG_FN(fn); + + if (TRACE_PTH_FNS) { + fprintf(stderr, "<< pthread_cond_clockwait %p %p %p", + cond, mutex, abstime); + fflush(stderr); + } + + /* Tell the tool a cond-wait is about to happen, so it can check + for bogus argument values. In return it tells us whether it + thinks the mutex is valid or not. */ + DO_CREQ_W_WW(mutex_is_valid, + _VG_USERREQ__HG_PTHREAD_COND_WAIT_PRE, + pthread_cond_t*,cond, pthread_mutex_t*,mutex); + assert(mutex_is_valid == 1 || mutex_is_valid == 0); + + abstime_is_valid = abstime->tv_nsec >= 0 && abstime->tv_nsec < 1000000000; + + /* Tell the tool we're about to drop the mutex. This reflects the + fact that in a cond_wait, we show up holding the mutex, and the + call atomically drops the mutex and waits for the cv to be + signalled. */ + if (mutex_is_valid && abstime_is_valid) { + DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_PRE, + pthread_mutex_t*,mutex); + } + + CALL_FN_W_WWWW(ret, fn, cond,mutex,clockid,abstime); + + if (mutex_is_valid && !abstime_is_valid && ret != EINVAL) { + DO_PthAPIerror("Bug in libpthread: pthread_cond_clockwait " + "invalid abstime did not cause" + " EINVAL", ret); + } + + if (mutex_is_valid && abstime_is_valid) { + /* and now we have the mutex again if (ret == 0 || ret == timeout) */ + DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_POST, + pthread_mutex_t *, mutex, + long, (ret == 0 || ret == timeout_error) ? True : False); + } + + DO_CREQ_v_WWWW(_VG_USERREQ__HG_PTHREAD_COND_WAIT_POST, + pthread_cond_t*,cond, pthread_mutex_t*,mutex, + long,ret == timeout_error, + long, (ret == 0 || ret == timeout_error) && mutex_is_valid + ? True : False); + + if (ret != 0 && ret != timeout_error) { + DO_PthAPIerror( "pthread_cond_clockwait", ret ); + } + + if (TRACE_PTH_FNS) { + fprintf(stderr, " cotimedwait -> %d >>\n", ret); + } + + return ret; +} + +#if defined(VGO_linux) + PTH_FUNC(int, pthreadZucondZuclockwait, // pthread_cond_clockwait + pthread_cond_t* cond, pthread_mutex_t* mutex, + clockid_t clockid, + struct timespec* abstime) { + return pthread_cond_clockwait_WRK(cond, mutex, clockid, abstime, ETIMEDOUT); + } +#endif + //----------------------------------------------------------- // glibc: pthread_cond_signal@GLIBC_2.0 |