Commit 063c13a3 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime/race: more precise handling of finalizers

Currently race detector runtime just disables race detection in the finalizer goroutine.
It has false positives when a finalizer writes to shared memory -- the race with finalizer is reported in a normal goroutine that accesses the same memory.
After this change I am going to synchronize the finalizer goroutine with the rest of the world in racefingo(). This is closer to what happens in reality and so
does not have false positives.
And also add README file with instructions how to build the runtime.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6810095
parent 51e89f59
......@@ -1137,9 +1137,6 @@ runfinq(void)
byte *frame;
uint32 framesz, framecap, i;
if(raceenabled)
runtime·racefingo();
frame = nil;
framecap = 0;
for(;;) {
......@@ -1156,6 +1153,8 @@ runfinq(void)
runtime·park(nil, nil, "finalizer wait");
continue;
}
if(raceenabled)
runtime·racefingo();
for(; fb; fb=next) {
next = fb->next;
for(i=0; i<fb->cnt; i++) {
......
runtime/race package contains the data race detector runtime library.
It is based on ThreadSanitizer race detector, that is currently a part of
the LLVM project.
To update the .syso files you need to:
$ svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk
$ cd compiler-rt/lib/tsan/go
$ ./buildgo.sh
Tested with gcc 4.6.1 and 4.7.0. On Windows it's built with 64-bit MinGW.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment