Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(91)

Issue 4673055: code review 4673055: runtime: fix data race during Itab hash update/lookup (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by dvyukov
Modified:
13 years, 9 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

runtime: fix data race during Itab hash update/lookup The data race is on newly published Itab nodes, which are both unsafely published and unsafely acquired. It can break on IA-32/Intel64 due to compiler optimizations (most likely not an issue as of now) and on ARM due to hardware memory access reorderings.

Patch Set 1 #

Patch Set 2 : diff -r f9725ff92a0c https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r f9725ff92a0c https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 4 : diff -r 207a10acbc0f https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 7f39a0541e03 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 7f39a0541e03 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 7f39a0541e03 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -5 lines) Patch
M src/pkg/runtime/386/asm.s View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/runtime/386/atomic.c View 1 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/runtime/amd64/asm.s View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/runtime/amd64/atomic.c View 1 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/runtime/arm/atomic.c View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M src/pkg/runtime/iface.c View 1 2 3 4 2 chunks +5 lines, -4 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 8
dvyukov
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 10 months ago (2011-07-11 15:41:44 UTC) #1
rsc
Nice http://codereview.appspot.com/4673055/diff/8002/src/pkg/runtime/arm/atomic.c File src/pkg/runtime/arm/atomic.c (right): http://codereview.appspot.com/4673055/diff/8002/src/pkg/runtime/arm/atomic.c#newcode18 src/pkg/runtime/arm/atomic.c:18: void* v; return (void*)runtime·xadd((uint32 volatile*)addr, 0); http://codereview.appspot.com/4673055/diff/8002/src/pkg/runtime/iface.c File ...
13 years, 10 months ago (2011-07-12 05:33:12 UTC) #2
dvyukov
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 10 months ago (2011-07-12 10:52:00 UTC) #3
dvyukov
> http://codereview.appspot.com/4673055/diff/8002/src/pkg/runtime/arm/atomic.c#newcode18 > src/pkg/runtime/arm/atomic.c:18: void* v; > return (void*)runtime·xadd((uint32 volatile*)addr, 0); Aha! ARM is always ...
13 years, 10 months ago (2011-07-12 10:59:38 UTC) #4
rsc
okay, then please add atomicstorep.
13 years, 10 months ago (2011-07-12 15:51:59 UTC) #5
dvyukov
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 10 months ago (2011-07-13 09:09:16 UTC) #6
rsc
LGTM
13 years, 10 months ago (2011-07-13 18:21:58 UTC) #7
rsc
13 years, 10 months ago (2011-07-13 18:22:44 UTC) #8
*** Submitted as http://code.google.com/p/go/source/detail?r=de991447d8ea ***

runtime: fix data race during Itab hash update/lookup
The data race is on newly published Itab nodes, which are
both unsafely published and unsafely acquired. It can
break on IA-32/Intel64 due to compiler optimizations
(most likely not an issue as of now) and on ARM due to
hardware memory access reorderings.

R=rsc
CC=golang-dev
http://codereview.appspot.com/4673055

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b