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

Issue 203233004: Oilpan: Fix worker thread termination finalization order issues. (Closed)

Created:
6 years, 9 months ago by Mads Ager (chromium)
Modified:
6 years, 9 months ago
CC:
blink-reviews, falken, horo+watch_chromium.org, kinuko+watch, oilpan-reviews
Visibility:
Public.

Description

Oilpan: Fix worker thread termination finalization order issues. We need to carry out the nullptr assignment to m_workerGlobalScope before notifying the proxy that the worker thread is going away. Otherwise, the main thread could destroy the WorkerThread object which owns the m_workerGlobalScope persistent before the assignment and that would lead to a use-after-free. It turns out that there are objects that keep the execution context alive in order to be able to determine if they are being destructed on the right thread. Therefore, clearing out the thread member in WorkerGlobalScope cannot be done before the WorkerGlobalScope is actually dead. Therefore, the larger change that Sigbjorn did will not work. (One example of this kind of dependency is SQLCallbackWrapper.) We need to just keep the thread member intact and let objects die normally. The call to detach needs to happen before we actually kill the worker thread because finalizers need to be able to access thread local data. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169460

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add back comment about not clearing m_thread #

Total comments: 2

Patch Set 3 : Update comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -8 lines) Patch
M Source/core/workers/WorkerGlobalScope.cpp View 1 1 chunk +6 lines, -8 lines 0 comments Download
M Source/core/workers/WorkerThread.cpp View 1 2 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Mads Ager (chromium)
6 years, 9 months ago (2014-03-18 13:44:27 UTC) #1
sof
lgtm Drop the initial para on the bug description?
6 years, 9 months ago (2014-03-18 13:51:27 UTC) #2
tkent
lgtm
6 years, 9 months ago (2014-03-18 13:53:56 UTC) #3
haraken
LGTM https://codereview.chromium.org/203233004/diff/1/Source/core/workers/WorkerGlobalScope.cpp File Source/core/workers/WorkerGlobalScope.cpp (left): https://codereview.chromium.org/203233004/diff/1/Source/core/workers/WorkerGlobalScope.cpp#oldcode208 Source/core/workers/WorkerGlobalScope.cpp:208: // they're finalized. Shall we keep this comment? ...
6 years, 9 months ago (2014-03-18 13:55:45 UTC) #4
Mads Ager (chromium)
Thanks guys. I reformatted the first paragraph. I left it in here because this change ...
6 years, 9 months ago (2014-03-18 14:08:09 UTC) #5
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-18 14:08:16 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/203233004/20001
6 years, 9 months ago (2014-03-18 14:08:18 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-18 14:11:59 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-18 14:12:00 UTC) #9
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-18 14:12:28 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/203233004/20001
6 years, 9 months ago (2014-03-18 14:12:38 UTC) #11
Vyacheslav Egorov (Google)
LGTM! https://codereview.chromium.org/203233004/diff/20001/Source/core/workers/WorkerThread.cpp File Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/203233004/diff/20001/Source/core/workers/WorkerThread.cpp#newcode151 Source/core/workers/WorkerThread.cpp:151: // otherwise leak and never be destructed. It ...
6 years, 9 months ago (2014-03-18 14:17:46 UTC) #12
Mads Ager (chromium)
The CQ bit was unchecked by ager@chromium.org
6 years, 9 months ago (2014-03-18 14:19:20 UTC) #13
Mads Ager (chromium)
https://codereview.chromium.org/203233004/diff/20001/Source/core/workers/WorkerThread.cpp File Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/203233004/diff/20001/Source/core/workers/WorkerThread.cpp#newcode151 Source/core/workers/WorkerThread.cpp:151: // otherwise leak and never be destructed. It is ...
6 years, 9 months ago (2014-03-18 14:23:54 UTC) #14
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-18 14:23:57 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/203233004/30001
6 years, 9 months ago (2014-03-18 14:24:07 UTC) #16
commit-bot: I haz the power
6 years, 9 months ago (2014-03-18 18:58:22 UTC) #17
Message was sent while issue was closed.
Change committed as 169460

Powered by Google App Engine
This is Rietveld 408576698