runtime: adopt race detector for runtime written in Go
Ignore memory access on g0/gsignal.
See the issue for context and explanation.
Fixes issue 8627.
Hello golang-codereviews@googlegroups.com (cc: rsc@golang.org), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
10 years, 6 months ago
(2014-09-02 07:42:57 UTC)
#1
Seems to fix the crashes I was running into. https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.go File src/pkg/runtime/cpuprof.go (right): https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.go#newcode267 src/pkg/runtime/cpuprof.go:267: ...
10 years, 6 months ago
(2014-09-02 16:23:42 UTC)
#2
https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/race.c File src/pkg/runtime/race.c (right): https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/race.c#newcode175 src/pkg/runtime/race.c:175: } Don't you also need to do racereadpc/racewritepc in ...
10 years, 6 months ago
(2014-09-02 19:49:23 UTC)
#3
Regarding the other comments. Racecall is the wrong place for the check, as main goroutine ...
10 years, 6 months ago
(2014-09-03 07:28:21 UTC)
#4
Regarding the other comments.
Racecall is the wrong place for the check, as main goroutine is created on g0.
Racecalladdr is the wrong place as the additional check with several
indirections will slow down programs by 10%. Racereadpc is not required right
now otherwise race tests would crash.
I agree that we need something more systematic in future. But the change will
complex and subtle and can potentially severely degrade performance. I don't
want to rewrite it just before release.
https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.go
File src/pkg/runtime/cpuprof.go (right):
https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.g...
src/pkg/runtime/cpuprof.go:267: for i := uintptr(0); i < d; i++ {
On 2014/09/02 16:23:41, mdempsky wrote:
> This loop can be replaced with
>
> copy(log[q:], e.stack[:d])
> q += d
>
> too, fwiw.
Done.
On 2014/09/03 07:28:21, dvyukov wrote: > Regarding the other comments. > Racecall is the wrong ...
10 years, 6 months ago
(2014-09-03 16:33:06 UTC)
#5
On 2014/09/03 07:28:21, dvyukov wrote:
> Regarding the other comments.
> Racecall is the wrong place for the check, as main goroutine is created on g0.
> Racecalladdr is the wrong place as the additional check with several
> indirections will slow down programs by 10%. Racereadpc is not required right
> now otherwise race tests would crash.
> I agree that we need something more systematic in future. But the change will
> complex and subtle and can potentially severely degrade performance. I don't
> want to rewrite it just before release.
>
> https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.go
> File src/pkg/runtime/cpuprof.go (right):
>
>
https://codereview.appspot.com/137070043/diff/40001/src/pkg/runtime/cpuprof.g...
> src/pkg/runtime/cpuprof.go:267: for i := uintptr(0); i < d; i++ {
> On 2014/09/02 16:23:41, mdempsky wrote:
> > This loop can be replaced with
> >
> > copy(log[q:], e.stack[:d])
> > q += d
> >
> > too, fwiw.
>
> Done.
LGTM.
Issue 137070043: code review 137070043: runtime: adapt race detector for runtime written in Goadapt
(Closed)
Created 10 years, 6 months ago by dvyukov
Modified 10 years, 6 months ago
Reviewers: gobot
Base URL:
Comments: 4