Ramki-Ravindran / data-race-test

Automatically exported from code.google.com/p/data-race-test
0 stars 0 forks source link

Different results for the same code, only changing the randomness of accessing elements #115

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When running the same code in the pure-happens-before=false mode, I get 
different results. In fact, I try to understand how tsan handles heap issues

What is the expected output? What do you see instead?
The result changes when I change when I uncomment the line
//index = rand() % SIZE;

So, if the line is commented I got 3 races where as when uncommented, 6 races.
I think this is about how the heap is handled, I want to know why we see 3 
races in the first case, and why 6 in the second case? What is the difference?

What version of the product are you using? On what operating system?
ubuntu 12.04,  tsan-r4431-amd64-linux-self-contained.sh

Please provide any additional information below.

Original issue reported on code.google.com by onderkal...@gmail.com on 26 Jul 2013 at 7:23

Attachments:

GoogleCodeExporter commented 9 years ago
This probably has something to do with automatic suppression of similar races. 
If you access a different element on line 59, this adds 3 new racy stack traces.
Btw, this old valgrind-based threadsanitizer is deprecated. We are currently 
developing and maintaing the new one:
https://code.google.com/p/thread-sanitizer/

Original comment by dvyu...@google.com on 26 Jul 2013 at 8:56