Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 392933002: Fix data race with synthetic delay initialization (Closed)

Created:
6 years, 5 months ago by Sami
Modified:
6 years, 5 months ago
CC:
chromium-reviews, dsinclair+watch_chromium.org, erikwright+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Fix data race with synthetic delay initialization The synthetic delay macro initializes a local atomic variable to point to a delay implementation class. Because initializing the class involves writing data to memory which is subsequently deferences through the atomic pointer, we need to use memory barries when updating the pointer to make sure the data behind it is committed. Thanks to Alexander Potapenko for spotting this. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284203

Patch Set 1 #

Total comments: 2

Patch Set 2 : Review comments. #

Patch Set 3 : Rebased. #

Patch Set 4 : Just the fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M base/debug/trace_event_synthetic_delay.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Sami
6 years, 5 months ago (2014-07-15 14:22:23 UTC) #1
dsinclair
lgtm
6 years, 5 months ago (2014-07-15 14:25:52 UTC) #2
Alexander Potapenko
LGTM https://codereview.chromium.org/392933002/diff/1/base/debug/trace_event_synthetic_delay_unittest.cc File base/debug/trace_event_synthetic_delay_unittest.cc (right): https://codereview.chromium.org/392933002/diff/1/base/debug/trace_event_synthetic_delay_unittest.cc#newcode172 base/debug/trace_event_synthetic_delay_unittest.cc:172: // synthetic delays so that dynamic analyzers like ...
6 years, 5 months ago (2014-07-15 14:30:15 UTC) #3
Sami
On 2014/07/15 14:30:15, Alexander Potapenko wrote: > LGTM > > https://codereview.chromium.org/392933002/diff/1/base/debug/trace_event_synthetic_delay_unittest.cc > File base/debug/trace_event_synthetic_delay_unittest.cc (right): ...
6 years, 5 months ago (2014-07-15 14:55:38 UTC) #4
Alexander Potapenko
I've tried your test under TSan with barriers removed, and it didn't report any data ...
6 years, 5 months ago (2014-07-15 15:51:08 UTC) #5
Sami
On 2014/07/15 15:51:08, Alexander Potapenko wrote: > I've tried your test under TSan with barriers ...
6 years, 5 months ago (2014-07-15 15:53:50 UTC) #6
Alexander Potapenko
On 2014/07/15 15:51:08, Alexander Potapenko wrote: > I've tried your test under TSan with barriers ...
6 years, 5 months ago (2014-07-15 16:05:12 UTC) #7
Alexander Potapenko
I've also noticed the ANNOTATE_BENIGN_RACE macros in trace_event_synthetic_delay.cc - did you copy them from base/debug/trace_event.h?
6 years, 5 months ago (2014-07-15 16:09:32 UTC) #8
Alexander Potapenko
On 2014/07/15 16:05:12, Alexander Potapenko wrote: > On 2014/07/15 15:51:08, Alexander Potapenko wrote: > > ...
6 years, 5 months ago (2014-07-15 16:30:59 UTC) #9
Sami
On 2014/07/15 16:30:59, Alexander Potapenko wrote: > I've the following scenario in my mind: > ...
6 years, 5 months ago (2014-07-15 18:22:36 UTC) #10
Alexander Potapenko
On 2014/07/15 18:22:36, Sami wrote: > On 2014/07/15 16:30:59, Alexander Potapenko wrote: > > I've ...
6 years, 5 months ago (2014-07-16 10:17:07 UTC) #11
Alexander Potapenko
By the way have you noticed the lock inversion reported by the TSan trybot: http://build.chromium.org/p/tryserver.chromium/builders/linux_clang_tsan/builds/320/steps/base_unittests/logs/stdio ...
6 years, 5 months ago (2014-07-16 11:49:28 UTC) #12
Alexander Potapenko
> > I played around with this in tsan a bit and it looks like ...
6 years, 5 months ago (2014-07-16 12:21:03 UTC) #13
Sami
Sorry for the delay in getting back to this... On 2014/07/16 12:21:03, Alexander Potapenko wrote: ...
6 years, 5 months ago (2014-07-18 16:49:44 UTC) #14
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 5 months ago (2014-07-18 16:50:55 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/392933002/60001
6 years, 5 months ago (2014-07-18 16:51:22 UTC) #16
commit-bot: I haz the power
6 years, 5 months ago (2014-07-18 21:27:16 UTC) #17
Message was sent while issue was closed.
Change committed as 284203

Powered by Google App Engine
This is Rietveld 408576698