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

Issue 268673012: Don't set WTF::Partitions::s_initialized to true before initializing (Closed)

Created:
6 years, 7 months ago by Jens Widell
Modified:
6 years, 6 months ago
CC:
blink-reviews, blink-reviews-wtf_chromium.org, Mikhail, adamk+blink_chromium.org, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Don't set WTF::Partitions::s_initialized to true before initializing In theory, a simultaneous caller to Partitions::getBufferPartition() could see the flag as being true, and return the uninitialized buffer partition, while another thread is initializing it. BUG=367672 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175020

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M Source/wtf/WTF.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Jens Widell
Please take a look. One could imagine that this could lead to start-up race crashes. ...
6 years, 7 months ago (2014-05-02 10:10:28 UTC) #1
Jens Widell
On 2014/05/02 10:10:28, Jens Lindström wrote: > Please take a look. > > One could ...
6 years, 7 months ago (2014-05-02 10:27:25 UTC) #2
eseidel
I doubt this does anything since this was already inside the lock, unless the initialize() ...
6 years, 7 months ago (2014-05-02 13:47:22 UTC) #3
Jens Widell
On 2014/05/02 13:47:22, eseidel wrote: > I doubt this does anything since this was already ...
6 years, 7 months ago (2014-05-02 15:02:14 UTC) #4
Jens Widell
On 2014/05/02 15:02:14, Jens Lindström wrote: > On 2014/05/02 13:47:22, eseidel wrote: > > I ...
6 years, 7 months ago (2014-05-02 15:21:08 UTC) #5
eseidel
lgtm
6 years, 6 months ago (2014-05-29 00:32:05 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/268673012/1
6 years, 6 months ago (2014-05-29 00:32:24 UTC) #7
commit-bot: I haz the power
Change committed as 175020
6 years, 6 months ago (2014-05-29 01:49:12 UTC) #8
Chris Evans
6 years, 6 months ago (2014-05-29 04:32:30 UTC) #9
Message was sent while issue was closed.
On 2014/05/02 10:10:28, Jens Lindström wrote:
> Please take a look.
> 
> One could imagine that this could lead to start-up race crashes.  No idea if
it
> causes any of the problems we're seeing.

[+tsepez]

I only just saw this bug / CL. Thanks so much for looking into it.

I'm not sure it's likely to be related to the observed crash but it does appear
to be a bug.

I wonder if the fix is correct though? The fast path does not take a lock so
couldn't CPU instruction re-ordering still cause s_initialized == true to be
seen before the partition is set up? Do we need to do an explicit memory barrier
after initializing the partition to make sure the s_initialized = true; write is
seen only after the partition is initialized?

Tom is stronger than myself on concurrency; cc:ed him for second opinion.

Powered by Google App Engine
This is Rietveld 408576698