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

Issue 311263008: Make |Heap::findGCInfo()| threadsafe. (Closed)

Created:
6 years, 6 months ago by kouhei (in TOK)
Modified:
6 years, 6 months ago
CC:
blink-reviews, haraken, kouhei+heap_chromium.org, Mads Ager (chromium)
Visibility:
Public.

Description

Make |Heap::findGCInfo()| threadsafe. Before this patch, |Heap::findGCInfo()|'s iteration on AttachedThreadStateSet was not guarded. This triggered "modification while iteration" assert when |Heap::findGCInfo()| was called from non-safepoint. This patch exposes |ThreadState::threadAttachMutex()| and |Heap::findGCInfo()| will acquire lock on it when we are not in safepoint. Unfortunately there are no trybot which has an ENABLE(GC_TRACING) flag. NOTRY=true TEST=content_shell --dump-render-tree http/tests/workers/terminate-during-sync-operation-websql.html wont crash. BUG=380474 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175774

Patch Set 1 #

Total comments: 2

Patch Set 2 : change check to isAnyThreadInGC #

Total comments: 5

Patch Set 3 : move iteration to ThreadState #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -7 lines) Patch
M Source/platform/heap/Heap.cpp View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M Source/platform/heap/ThreadState.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/heap/ThreadState.cpp View 1 2 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
kouhei (in TOK)
6 years, 6 months ago (2014-06-05 08:58:56 UTC) #1
haraken
https://codereview.chromium.org/311263008/diff/1/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/311263008/diff/1/Source/platform/heap/Heap.cpp#newcode1603 Source/platform/heap/Heap.cpp:1603: bool needLockForIteration = !ThreadState::current()->isAtSafePoint(); I guess what matters is ...
6 years, 6 months ago (2014-06-05 09:11:23 UTC) #2
kouhei (in TOK)
https://codereview.chromium.org/311263008/diff/1/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/311263008/diff/1/Source/platform/heap/Heap.cpp#newcode1603 Source/platform/heap/Heap.cpp:1603: bool needLockForIteration = !ThreadState::current()->isAtSafePoint(); On 2014/06/05 09:11:23, haraken wrote: ...
6 years, 6 months ago (2014-06-05 09:26:21 UTC) #3
haraken
LGTM. In my understanding, this change won't cause dead-lock, but I want to have Denmark ...
6 years, 6 months ago (2014-06-05 09:31:18 UTC) #4
Mads Ager (chromium)
https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp#newcode1611 Source/platform/heap/Heap.cpp:1611: ThreadState::threadAttachMutex().unlock(); Do we have a scoped lock object that ...
6 years, 6 months ago (2014-06-06 06:54:01 UTC) #5
kouhei (in TOK)
https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp#newcode1611 Source/platform/heap/Heap.cpp:1611: ThreadState::threadAttachMutex().unlock(); On 2014/06/06 06:54:01, Mads Ager (chromium) wrote: > ...
6 years, 6 months ago (2014-06-06 06:58:26 UTC) #6
Mads Ager (chromium)
LGTM with the actual code moved to ThreadState. https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/311263008/diff/20001/Source/platform/heap/Heap.cpp#newcode1611 Source/platform/heap/Heap.cpp:1611: ThreadState::threadAttachMutex().unlock(); ...
6 years, 6 months ago (2014-06-06 07:03:30 UTC) #7
kouhei (in TOK)
On 2014/06/06 07:03:30, Mads Ager (chromium) wrote: > LGTM with the actual code moved to ...
6 years, 6 months ago (2014-06-09 05:21:50 UTC) #8
kouhei (in TOK)
The CQ bit was checked by kouhei@chromium.org
6 years, 6 months ago (2014-06-09 05:21:52 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kouhei@chromium.org/311263008/40001
6 years, 6 months ago (2014-06-09 05:22:15 UTC) #10
commit-bot: I haz the power
6 years, 6 months ago (2014-06-09 05:22:35 UTC) #11
Message was sent while issue was closed.
Change committed as 175774

Powered by Google App Engine
This is Rietveld 408576698