Ramki-Ravindran / thread-sanitizer

Automatically exported from code.google.com/p/thread-sanitizer
0 stars 0 forks source link

False negative on accessing global variable without any lock when another access with a lock follows. #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the attached c program with threadsanitizer.
2. Run it
3. Notice that if we uncomment the sleep, threadsanitizer will detect the race.

What is the expected output? What do you see instead?

Without the sleep, nothing is printed. With the sleep, a race report is printed.

What version of the product are you using? On what operating system?

r219746

Please provide any additional information below.

I also tested putting a sleep in the end of the threads to make sure it is not 
related to a thread finishing before the other runs. Same result.

Original issue reported on code.google.com by mateus.a...@gmail.com on 12 Nov 2014 at 2:57

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, this is expected behavior for any pure-happens-before detector. 
You can find more discussion of pure-happens-before vs others (lockset, hybrid)
e.g. at http://research.google.com/pubs/archive/35604.pdf

At the moment we don't have any plans to implement non-pure-happens-before 
algorithm. 

Original comment by konstant...@gmail.com on 12 Nov 2014 at 5:33