Bug 416286

Summary: DRD reports “conflicting load” error on std::mutex::lock
Product: [Developer tools] valgrind Reporter: igor.chorazewicz
Component: drdAssignee: Bart Van Assche <bart.vanassche+kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.15 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test code
drd log

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.