Bug 446081 - DRD/Helgrind with C++11 std::condition_variable::wait_until, several issues
Summary: DRD/Helgrind with C++11 std::condition_variable::wait_until, several issues
Status: RESOLVED NOT A BUG
Alias: None
Product: valgrind
Classification: Developer tools
Component: drd (other bugs)
Version First Reported In: 3.19 GIT
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Bart Van Assche
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-25 15:40 UTC by Paul Floyd
Modified: 2021-11-26 21:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
helgrind/freebsd (14.02 KB, text/x-log)
2021-11-25 15:40 UTC, Paul Floyd
Details
drd/freebsd (12.14 KB, text/x-log)
2021-11-25 15:40 UTC, Paul Floyd
Details
helgrind/linux (22.48 KB, text/x-log)
2021-11-25 16:35 UTC, Paul Floyd
Details
drd/linux (45.72 KB, text/x-log)
2021-11-25 16:36 UTC, Paul Floyd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Floyd 2021-11-25 15:40:13 UTC
Created attachment 143936 [details]
helgrind/freebsd

I was looking fort examples that exercise the new pthread_clock APIS. The template code is a bit hard to read between the templates and conditional compilation but it seems to me that

std::timed_mutex (and timed_recursive_mutex) may use pthread_mutex_clocklock
std::shared_timed_mutex may use pthread_rwlock_clockwrlock and pthread_rwlock_clockrdlock

I started with this example https://en.cppreference.com/w/cpp/thread/condition_variable/wait_until
(need to check that it really is using some of the above functions. It generates several errors with both helgrind and drd.

I also need to try
https://en.cppreference.com/w/cpp/thread/shared_timed_mutex/try_lock_until
and
https://en.cppreference.com/w/cpp/thread/timed_mutex/try_lock_until

There seems to be a fair bit going wrong here. For comparison here are logs from FreeBSD (which I know has other issues, but the cv.wait_until used the timed rather than the clock version).
Comment 1 Paul Floyd 2021-11-25 15:40:30 UTC
Created attachment 143937 [details]
drd/freebsd
Comment 2 Paul Floyd 2021-11-25 16:35:27 UTC
Hmm. This test does use 'timed' rather than 'clock'. I'll carry on trying to debug it.
Comment 3 Paul Floyd 2021-11-25 16:35:54 UTC
Created attachment 143939 [details]
helgrind/linux
Comment 4 Paul Floyd 2021-11-25 16:36:12 UTC
Created attachment 143940 [details]
drd/linux
Comment 5 Paul Floyd 2021-11-26 21:16:02 UTC
This doesn't produce the errors that I was expecting. Though there are numerous errors I'll close it and deal with them separately.