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

Issue 263163006: Fix crash when ExecutionContext is torn down before a crypto operation has completed. (Closed)

Created:
6 years, 7 months ago by eroman
Modified:
6 years, 7 months ago
CC:
blink-reviews, Nils Barth (inactive), arv+blink, jsbell+bindings_chromium.org, sof, kouhei+bindings_chromium.org, marja+watch_chromium.org, blink-reviews-bindings_chromium.org, Nate Chapin
Visibility:
Public.

Description

Fix crash when ExecutionContext is torn down before a crypto operation has completed. The issue is that ActiveDOMObjects cannot be deleted as part of a different observer's contextDestroyed(). The solution taken here is to subclass PromiseResolveWithContext so that the deletion is done as part of its contextDestroyed() instead. BUG=368821, 245025 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173981

Patch Set 1 #

Patch Set 2 : Add layout test #

Total comments: 2

Patch Set 3 : fix comment typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -13 lines) Patch
A LayoutTests/crypto/abandon-crypto-operation.html View 1 1 chunk +42 lines, -0 lines 0 comments Download
A + LayoutTests/crypto/abandon-crypto-operation-expected.txt View 1 1 chunk +4 lines, -1 line 0 comments Download
A LayoutTests/crypto/resources/worker-infinite-loop-generateKey.js View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M Source/bindings/v8/ScriptPromiseResolverWithContext.h View 3 chunks +4 lines, -3 lines 0 comments Download
M Source/modules/crypto/CryptoResultImpl.cpp View 3 chunks +33 lines, -9 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
eroman
6 years, 7 months ago (2014-05-06 00:32:49 UTC) #1
abarth-chromium
Test?
6 years, 7 months ago (2014-05-06 00:38:37 UTC) #2
eroman
Thanks, I will try to add a test shortly! It also reproduces using the existing ...
6 years, 7 months ago (2014-05-06 00:40:22 UTC) #3
eroman
Added a corresponding layout test, PTAL
6 years, 7 months ago (2014-05-06 01:36:52 UTC) #4
haraken
https://codereview.chromium.org/263163006/diff/40001/Source/modules/crypto/CryptoResultImpl.cpp File Source/modules/crypto/CryptoResultImpl.cpp (right): https://codereview.chromium.org/263163006/diff/40001/Source/modules/crypto/CryptoResultImpl.cpp#newcode154 Source/modules/crypto/CryptoResultImpl.cpp:154: virtual void contextDestroyed() OVERRIDE How about adding the functionality ...
6 years, 7 months ago (2014-05-06 01:44:01 UTC) #5
eroman
https://codereview.chromium.org/263163006/diff/40001/Source/modules/crypto/CryptoResultImpl.cpp File Source/modules/crypto/CryptoResultImpl.cpp (right): https://codereview.chromium.org/263163006/diff/40001/Source/modules/crypto/CryptoResultImpl.cpp#newcode154 Source/modules/crypto/CryptoResultImpl.cpp:154: virtual void contextDestroyed() OVERRIDE On 2014/05/06 01:44:02, haraken wrote: ...
6 years, 7 months ago (2014-05-06 22:59:21 UTC) #6
yhirano
A ScriptPromiseResolverWithContext releases almost all information when resolved, rejected or the associated ExecutionContext is stopped. ...
6 years, 7 months ago (2014-05-07 06:11:34 UTC) #7
eroman
Let me try and explain the use case a little bit more clearly: When starting ...
6 years, 7 months ago (2014-05-07 21:54:40 UTC) #8
yhirano
Let me summarize to check if I understand correctly. - Resolution and rejection happen on ...
6 years, 7 months ago (2014-05-08 03:48:30 UTC) #9
yhirano
Adam, do we really need TemporaryChange in LifeCycleNotifier::~LifeCycleNotifier? The function removes all observers and it ...
6 years, 7 months ago (2014-05-08 04:12:37 UTC) #10
yhirano
By the way, abandon-crypto-operation.html sometimes crashes in my local environment with PS3. There may be ...
6 years, 7 months ago (2014-05-08 04:18:04 UTC) #11
eroman
Yes exactly! The circumstance when CryptoResultImpl gets destroyed from another thread is when the Promise ...
6 years, 7 months ago (2014-05-08 04:21:42 UTC) #12
eroman
Yes I have been debugging a flake issue happening on another of my worker tests, ...
6 years, 7 months ago (2014-05-08 04:26:05 UTC) #13
abarth-chromium
On 2014/05/08 04:12:37, yhirano wrote: > Adam, do we really need TemporaryChange in > LifeCycleNotifier::~LifeCycleNotifier? ...
6 years, 7 months ago (2014-05-08 13:03:10 UTC) #14
yhirano
I see. > the assersion on ~LifeCycleNotifier Eric, can you try the following? I'm not ...
6 years, 7 months ago (2014-05-08 15:30:38 UTC) #15
eroman
Thanks for the suggestion. I am not quite sure if I am understanding the proposal ...
6 years, 7 months ago (2014-05-08 19:20:44 UTC) #16
eroman
In response to comment #11 (that flakiness is still observed with patch 3): I have ...
6 years, 7 months ago (2014-05-08 21:47:30 UTC) #17
yhirano
>#15, #16 I tried it by myself and it was nasty. PS3 LGTM. The root ...
6 years, 7 months ago (2014-05-09 06:13:33 UTC) #18
eroman
Thanks! I will go ahead and land this fix then since I want the flaky ...
6 years, 7 months ago (2014-05-09 18:51:43 UTC) #19
eroman
The CQ bit was checked by eroman@chromium.org
6 years, 7 months ago (2014-05-09 19:19:42 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eroman@chromium.org/263163006/60001
6 years, 7 months ago (2014-05-09 19:21:29 UTC) #21
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-09 20:33:37 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-09 20:48:06 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/5108)
6 years, 7 months ago (2014-05-09 20:48:06 UTC) #24
eroman
abarth or haraken, could you review? Thanks! ** Presubmit ERRORS ** Missing LGTM from an ...
6 years, 7 months ago (2014-05-09 21:20:21 UTC) #25
eroman
ping @haraken, would you mind taking a look for OWNERS approval?
6 years, 7 months ago (2014-05-13 18:30:24 UTC) #26
haraken
LGTM
6 years, 7 months ago (2014-05-13 19:24:23 UTC) #27
eroman
The CQ bit was checked by eroman@chromium.org
6 years, 7 months ago (2014-05-13 19:28:09 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eroman@chromium.org/263163006/60001
6 years, 7 months ago (2014-05-13 19:28:29 UTC) #29
commit-bot: I haz the power
6 years, 7 months ago (2014-05-13 19:42:22 UTC) #30
Message was sent while issue was closed.
Change committed as 173981

Powered by Google App Engine
This is Rietveld 408576698