Bug 446139

Summary: DRD/Helgrind with std::shared_timed_mutex::try_lock_until and try_lock_shared_until false positives
Product: [Developer tools] valgrind Reporter: Paul Floyd <pjfloyd>
Component: drdAssignee: Bart Van Assche <bart.vanassche+kde>
Status: RESOLVED FIXED    
Severity: normal CC: mark
Priority: NOR    
Version First Reported In: 3.19 GIT   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: testcase
initial patch
full patch with testcases

Description Paul Floyd 2021-11-26 21:32:23 UTC
Created attachment 143984 [details]
testcase

Similar to https://bugs.kde.org/show_bug.cgi?id=446138

Again on Fedora 34

This time it is pthread_rwlock_clockrdlock and pthread_rwlock_clockrwrlock that do not have intercepts.

This gives several false positives e.g. Helgrind
==16048== Thread #3 unlocked lock at 0x406220 currently held by thread #1
==16048==    at 0x484A573: pthread_rwlock_unlock_WRK (hg_intercepts.c:2683)
==16048==    by 0x484CA97: pthread_rwlock_unlock (hg_intercepts.c:2702)

and DRD

==16064== Reader-writer lock not locked by calling thread: rwlock 0x406220.
==16064==    at 0x486722B: pthread_rwlock_unlock_intercept (drd_pthread_intercepts.c:1855)
==16064==    by 0x486722B: pthread_rwlock_unlock (drd_pthread_intercepts.c:1869)
Comment 1 Paul Floyd 2021-11-26 21:34:09 UTC
Created attachment 143985 [details]
initial patch

Suggested patch for this and 446138
Comment 2 Paul Floyd 2021-11-27 21:07:48 UTC
Created attachment 144011 [details]
full patch with testcases

Helgrind/DRD now function with this patch
Comment 3 Paul Floyd 2021-11-27 21:09:08 UTC
Mark, you might want to backport this one on Fedora also.
Comment 4 Paul Floyd 2021-12-01 23:21:09 UTC
Committed with
commit c2607e093c54abe473b1d419cbdbba403cc87cdf