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

Issue 535193002: [ServiceWorker] Add NULL check of ExecutionContext in FetchBodyStream::readAsync (Closed)

Created:
6 years, 3 months ago by horo
Modified:
6 years, 3 months ago
CC:
blink-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, nhiroki, falken, kinuko+serviceworker, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

[ServiceWorker] Add NULL check of ExecutionContext in FetchBodyStream::readAsync scriptState->executionContext() returns NULL in the following situation. [Main thread] - WorkerThread::stop() - m_workerGlobalScope->script()->scheduleExecutionTermination(); - v8::V8::TerminateExecution(m_isolate); [Worker thread] - FetchBodyStream::readAsync() - ScriptPromiseResolver::create() ---> v8::Promise::Resolver::New() - v8::internal::Execution::Call - v8::internal::Invoke - JS - v8::internal::__RT_impl_Runtime_StackGuard - v8::internal::Isolate::TerminateExecution() Sets TerminationException. - scriptState->executionContext() - toExecutionContext() - V8WorkerGlobalScope::findInstanceInPrototypeChain() - V8PerIsolateData::findInstanceInPrototypeChain() - V8PerIsolateData::findInstanceInPrototypeChain() - v8::Object::FindInstanceInPrototypeChain() - ON_BAILOUT(isolate, "v8::Object::FindInstanceInPrototypeChain()", return Local<v8::Object>()); - IsExecutionTerminatingCheck() Returns true. BUG=409755 TEST=run_webkit_tests http/tests/serviceworker/request.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181872

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Patch Set 3 : same as patch set 1 #

Total comments: 2

Patch Set 4 : Move to Body.cpp and add comment #

Total comments: 4

Patch Set 5 : incorporated haraken's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -1 line) Patch
M Source/modules/serviceworkers/Body.cpp View 1 2 3 4 2 chunks +11 lines, -1 line 0 comments Download

Messages

Total messages: 29 (6 generated)
horo
yhirano@ Could you please review?
6 years, 3 months ago (2014-09-03 15:56:44 UTC) #2
yhirano
Does that mean every V8 code execution on workerthread could clear scriptState? Is this the ...
6 years, 3 months ago (2014-09-04 04:34:27 UTC) #3
horo
> Does that mean every V8 code execution on workerthread could clear scriptState? I'm not ...
6 years, 3 months ago (2014-09-04 04:58:46 UTC) #4
yhirano
On 2014/09/04 04:58:46, horo wrote: > > Does that mean every V8 code execution on ...
6 years, 3 months ago (2014-09-04 07:32:10 UTC) #6
haraken
https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp File Source/modules/serviceworkers/FetchBodyStream.cpp (right): https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp#newcode30 Source/modules/serviceworkers/FetchBodyStream.cpp:30: if (m_hasRead) I think you should check m_scriptState->contextIsEmpty() here. ...
6 years, 3 months ago (2014-09-04 08:13:03 UTC) #7
horo
https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp File Source/modules/serviceworkers/FetchBodyStream.cpp (right): https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp#newcode30 Source/modules/serviceworkers/FetchBodyStream.cpp:30: if (m_hasRead) On 2014/09/04 08:13:03, haraken wrote: > > ...
6 years, 3 months ago (2014-09-04 09:54:29 UTC) #9
yhirano
On 2014/09/04 09:54:29, horo wrote: > https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp > File Source/modules/serviceworkers/FetchBodyStream.cpp (right): > > https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp#newcode30 > ...
6 years, 3 months ago (2014-09-04 11:10:49 UTC) #10
yhirano
On 2014/09/04 11:10:49, yhirano wrote: > On 2014/09/04 09:54:29, horo wrote: > > > https://codereview.chromium.org/535193002/diff/1/Source/modules/serviceworkers/FetchBodyStream.cpp ...
6 years, 3 months ago (2014-09-04 11:11:50 UTC) #11
horo
On 2014/09/04 11:11:50, yhirano wrote: > On 2014/09/04 11:10:49, yhirano wrote: > > On 2014/09/04 ...
6 years, 3 months ago (2014-09-04 12:12:44 UTC) #12
yhirano
https://codereview.chromium.org/535193002/diff/60001/Source/modules/serviceworkers/FetchBodyStream.cpp File Source/modules/serviceworkers/FetchBodyStream.cpp (right): https://codereview.chromium.org/535193002/diff/60001/Source/modules/serviceworkers/FetchBodyStream.cpp#newcode34 Source/modules/serviceworkers/FetchBodyStream.cpp:34: m_responseType = type; Can you protect the ExecutionContext by ...
6 years, 3 months ago (2014-09-05 06:17:16 UTC) #13
haraken
Actually I'm not sure if adding a null check is a right fix here. After ...
6 years, 3 months ago (2014-09-05 06:40:57 UTC) #14
horo
On 2014/09/05 06:40:57, haraken wrote: > Actually I'm not sure if adding a null check ...
6 years, 3 months ago (2014-09-11 06:15:27 UTC) #15
yhirano
On 2014/09/11 06:15:27, horo wrote: > On 2014/09/05 06:40:57, haraken wrote: > > Actually I'm ...
6 years, 3 months ago (2014-09-11 11:04:17 UTC) #16
haraken
On 2014/09/11 11:04:17, yhirano wrote: > On 2014/09/11 06:15:27, horo wrote: > > On 2014/09/05 ...
6 years, 3 months ago (2014-09-11 12:14:28 UTC) #18
dcarney
s particular case of FileStream, I think a right fix would be to stop the ...
6 years, 3 months ago (2014-09-11 12:29:23 UTC) #19
horo
> In this particular case of FileStream, I think a right fix would be to ...
6 years, 3 months ago (2014-09-11 12:43:21 UTC) #20
haraken
On 2014/09/11 12:43:21, horo wrote: > > In this particular case of FileStream, I think ...
6 years, 3 months ago (2014-09-11 12:59:10 UTC) #21
horo
> I don't think your fix is right but I cannot come up with any ...
6 years, 3 months ago (2014-09-11 15:37:15 UTC) #23
haraken
LGTM as a short-term fix. It's still possible that the termination signal is sent to ...
6 years, 3 months ago (2014-09-11 16:20:02 UTC) #24
horo
https://codereview.chromium.org/535193002/diff/100001/Source/modules/serviceworkers/Body.cpp File Source/modules/serviceworkers/Body.cpp (right): https://codereview.chromium.org/535193002/diff/100001/Source/modules/serviceworkers/Body.cpp#newcode23 Source/modules/serviceworkers/Body.cpp:23: // main thread. On 2014/09/11 16:20:01, haraken wrote: > ...
6 years, 3 months ago (2014-09-11 16:49:55 UTC) #25
yhirano
lgtm
6 years, 3 months ago (2014-09-12 01:12:23 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/535193002/120001
6 years, 3 months ago (2014-09-12 01:24:08 UTC) #28
commit-bot: I haz the power
6 years, 3 months ago (2014-09-12 03:08:43 UTC) #29
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as 181872

Powered by Google App Engine
This is Rietveld 408576698