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

Issue 1287963002: Fix race at blink::GCInfoAtBase<T>::index (Closed)

Created:
5 years, 4 months ago by ssid
Modified:
5 years, 4 months ago
Reviewers:
haraken
CC:
blink-reviews, oilpan-reviews, kouhei+heap_chromium.org, Mads Ager (chromium), tkonchada
Base URL:
https://chromium.googlesource.com/chromium/blink.git@oilpan_1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix race at blink::GCInfoAtBase<T>::index DEFINE_STATIC_LOCAL is not thread safe and blink::GCInfoAtBase<T>::index need to be called on multiple threads. This causes race condition. This cl changes the struct to use a function pointer instead of the string itself. The string gets generated only when user asks for the class name. BUG=519999, 490087 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200451

Patch Set 1 #

Patch Set 2 : Nits. #

Patch Set 3 : Adding assert. #

Total comments: 1

Patch Set 4 : Using atomic initialization. #

Patch Set 5 : non-atomic with a comment. #

Patch Set 6 : Nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -4 lines) Patch
M Source/platform/heap/GCInfo.h View 1 2 chunks +5 lines, -4 lines 0 comments Download
M Source/platform/heap/Visitor.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 14 (4 generated)
ssid
Please see if this fix makes sense. I couldn't reproduce the race. Thanks
5 years, 4 months ago (2015-08-12 09:29:35 UTC) #2
ssid
+tkonchada
5 years, 4 months ago (2015-08-12 09:43:59 UTC) #3
haraken
https://codereview.chromium.org/1287963002/diff/40001/Source/platform/heap/Visitor.h File Source/platform/heap/Visitor.h (right): https://codereview.chromium.org/1287963002/diff/40001/Source/platform/heap/Visitor.h#newcode394 Source/platform/heap/Visitor.h:394: ASSERT(isMainThread()); It is not guaranteed that get() is called ...
5 years, 4 months ago (2015-08-12 12:33:41 UTC) #4
ssid
On 2015/08/12 12:33:41, haraken wrote: > https://codereview.chromium.org/1287963002/diff/40001/Source/platform/heap/Visitor.h > File Source/platform/heap/Visitor.h (right): > > https://codereview.chromium.org/1287963002/diff/40001/Source/platform/heap/Visitor.h#newcode394 > ...
5 years, 4 months ago (2015-08-12 12:54:56 UTC) #5
ssid
On 2015/08/12 12:54:56, ssid wrote: > On 2015/08/12 12:33:41, haraken wrote: > > > https://codereview.chromium.org/1287963002/diff/40001/Source/platform/heap/Visitor.h ...
5 years, 4 months ago (2015-08-12 12:56:25 UTC) #6
haraken
On 2015/08/12 12:56:25, ssid wrote: > On 2015/08/12 12:54:56, ssid wrote: > > On 2015/08/12 ...
5 years, 4 months ago (2015-08-12 13:09:57 UTC) #7
ssid
It was complicated change just for an assert, since I cannot get the correct ThreadState ...
5 years, 4 months ago (2015-08-12 17:04:36 UTC) #8
haraken
On 2015/08/12 17:04:36, ssid wrote: > It was complicated change just for an assert, since ...
5 years, 4 months ago (2015-08-12 23:36:06 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1287963002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1287963002/120001
5 years, 4 months ago (2015-08-13 01:03:22 UTC) #13
commit-bot: I haz the power
5 years, 4 months ago (2015-08-13 02:32:03 UTC) #14
Message was sent while issue was closed.
Committed patchset #6 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200451

Powered by Google App Engine
This is Rietveld 408576698