Bug 416286 - DRD reports “conflicting load” error on std::mutex::lock
Summary: DRD reports “conflicting load” error on std::mutex::lock
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: drd (show other bugs)
Version: 3.15 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Bart Van Assche
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-15 11:30 UTC by igor.chorazewicz
Modified: 2020-04-13 02:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
test code (545 bytes, text/x-c++src)
2020-01-15 11:30 UTC, igor.chorazewicz
Details
drd log (2.41 KB, text/plain)
2020-01-15 11:31 UTC, igor.chorazewicz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description igor.chorazewicz 2020-01-15 11:30:54 UTC
Created attachment 125144 [details]
test code

When I run attached code under drd I get "conflicting load" error on std::mutex::lock. Both removing 'counter' constructor and calling 'get_counter' in main thread before any thread starts solves the issue. It seems drd thinks that static initialization of an object is not thread safe.

I tested this with g++-9.2.1 and clang++ 9.0.0.
Comment 1 igor.chorazewicz 2020-01-15 11:31:17 UTC
Created attachment 125145 [details]
drd log
Comment 2 Bart Van Assche 2020-01-16 04:35:12 UTC
Thanks for having reported this. Please check whether the changes that have been checked in on the master branch fix this issue.
Comment 3 igor.chorazewicz 2020-01-21 13:40:12 UTC
Yes, drd does not complain anymore after the fix.