From: Paul F. <pa...@so...> - 2025-04-09 06:53:05
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4f023b20b98880a838f1abe946c4446b579771a4 commit 4f023b20b98880a838f1abe946c4446b579771a4 Author: Paul Floyd <pj...@wa...> Date: Wed Apr 9 08:49:52 2025 +0200 Helgrind: Fixes for ETIMEDOUT pthread_rwlock_timedrdlock and pthread_rwlock_clockrdlock were generating API errors if they timed out. This fixes that and only generates API errors for non-zero and non-ETIMEDOUT return codes. Diff: --- helgrind/hg_intercepts.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index d41cb66048..e639abca84 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -2781,8 +2781,10 @@ static int pthread_rwlock_timedrdlock_WRK(pthread_rwlock_t *rwlock, 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_timedrdlock", ret); + if (ret != ETIMEDOUT) + DO_PthAPIerror("pthread_rwlock_timedrdlock", ret); } if (TRACE_PTH_FNS) { @@ -2847,8 +2849,10 @@ static int pthread_rwlock_clockrdlock_WRK(pthread_rwlock_t *rwlock, pthread_rwlock_t *, rwlock, long, 0/*isW*/, long, (ret == 0) ? True : False); } + if (ret != 0) { - DO_PthAPIerror("pthread_rwlock_clockrdlock", ret); + if (ret != ETIMEDOUT) + DO_PthAPIerror("pthread_rwlock_clockrdlock", ret); } if (TRACE_PTH_FNS) { |