From: Paul F. <pa...@so...> - 2025-04-02 19:42:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e633d2c8c56d342726f98d55e42c6fbdc875bd54 commit e633d2c8c56d342726f98d55e42c6fbdc875bd54 Author: Paul Floyd <pj...@wa...> Date: Wed Apr 2 21:39:54 2025 +0200 Illumos helgrind: pthread wrapper tweaks Wrap pthread_cond_timedwait which seems to have supplanted cond_reltimedwait on Illumos. pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock both exist on illumos, so enable those wrappers. Diff: --- helgrind/hg_intercepts.c | 9 +++++++-- helgrind/tests/filter_stderr_solaris | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 950d71b83c..661ab1a093 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -1526,6 +1526,11 @@ static int pthread_cond_timedwait_WRK(pthread_cond_t* cond, struct timespec *reltime) { return pthread_cond_timedwait_WRK(cond, mutex, reltime, ETIME); } + PTH_FUNC(int, pthreadZucondZutimedwait, // pthread_cond_timedwait + pthread_cond_t* cond, pthread_mutex_t* mutex, + struct timespec* abstime) { + return pthread_cond_timedwait_WRK(cond, mutex, abstime, ETIMEDOUT); + } #else # error "Unsupported OS" #endif @@ -2810,7 +2815,7 @@ PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock # error "Unsupported OS" #endif -#if defined(VGO_linux) +#if defined(VGO_linux) || defined(VGO_solaris) //----------------------------------------------------------- // glibc: pthread_rwlock_clockrdlock // @@ -2917,7 +2922,7 @@ PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock # error "Unsupported OS" #endif -#if defined(VGO_linux) +#if defined(VGO_linux) || defined(VGO_solaris) //----------------------------------------------------------- // glibc: pthread_rwlock_clockwrlock // diff --git a/helgrind/tests/filter_stderr_solaris b/helgrind/tests/filter_stderr_solaris index 41d1f1ef59..56ecfb3fb0 100755 --- a/helgrind/tests/filter_stderr_solaris +++ b/helgrind/tests/filter_stderr_solaris @@ -2,6 +2,8 @@ # Replace pthread_create with pthread_create@* which is expected on Linux s/pthread_create \(hg_intercepts.c:/pthread_create@* \(hg_intercepts.c:/g; +# Illumos uses pthread function names (in some cases?) +s/pthread_cond_timedwait \(hg_intercepts.c:/pthread_cond_timedwait@* \(hg_intercepts.c:/; # We need to remove stack frames containing redundant function # names from libc, for example |