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

Issue 15739014: Avoid referencing an HTMLMediaElement if is currently being deleted (Closed)

Created:
7 years, 6 months ago by vcarbune.chromium
Modified:
7 years, 6 months ago
CC:
blink-reviews, feature-media-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

If an event is created using as target an HTMLMediaElement which is currently being deleted it becomes a heap-use-after free situation. The GenericEventQueue instance is already owned by the HTMLMediaElement, and there already is an underlying mechanism to set the target of the event to NULL, if their target is owner of the queue. In order to avoid creating this reference in the first place, we enqueue the event with a NULL target to defer the refcount increment until the timer for dispatching the event happens (which won't happen at all if garbage collection is already destroying the objects). BUG=243045 R=inferno,acolwell Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151692

Patch Set 1 #

Total comments: 1

Patch Set 2 : Update #

Patch Set 3 : Build fix #

Patch Set 4 : Rebased #

Total comments: 2

Patch Set 5 : Fixed build error again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -5 lines) Patch
A LayoutTests/media/track/media-element-enqueue-event-crash.html View 1 1 chunk +60 lines, -0 lines 0 comments Download
A LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt View 1 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/dom/GenericEventQueue.cpp View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 2 4 5 chunks +8 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
vcarbune.chromium
I did try thinking about alternatives to this, but this seems to be the most ...
7 years, 6 months ago (2013-05-30 15:57:47 UTC) #1
aarya
I don't know this code well enough to review this. Adding Adam and Eric.
7 years, 6 months ago (2013-05-30 16:07:27 UTC) #2
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/15739014/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/15739014/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode521 Source/core/html/HTMLMediaElement.cpp:521: m_asyncEventQueue->enqueueEventWithoutTarget(event.release()); This doesn't seem right to me. I believe ...
7 years, 6 months ago (2013-05-30 17:07:59 UTC) #3
dglazkov
Can you help me understand how an event is fired during HTMLMediaElement destructor? That seems ...
7 years, 6 months ago (2013-05-30 17:18:09 UTC) #4
vcarbune.chromium
On 2013/05/30 17:18:09, Dimitri Glazkov wrote: > Can you help me understand how an event ...
7 years, 6 months ago (2013-05-30 17:44:34 UTC) #5
dglazkov
On 2013/05/30 17:44:34, vcarbune.chromium wrote: > > If you look at the stack trace from ...
7 years, 6 months ago (2013-05-30 17:52:24 UTC) #6
vcarbune.chromium
On 2013/05/30 17:52:24, Dimitri Glazkov wrote: > On 2013/05/30 17:44:34, vcarbune.chromium wrote: > > > ...
7 years, 6 months ago (2013-05-30 23:06:50 UTC) #7
acolwell GONE FROM CHROMIUM
On 2013/05/30 23:06:50, vcarbune.chromium wrote: > On 2013/05/30 17:52:24, Dimitri Glazkov wrote: > > On ...
7 years, 6 months ago (2013-05-31 00:01:43 UTC) #8
vcarbune.chromium
On 2013/05/31 00:01:43, acolwell wrote: > On 2013/05/30 23:06:50, vcarbune.chromium wrote: > > On 2013/05/30 ...
7 years, 6 months ago (2013-05-31 00:04:41 UTC) #9
acolwell GONE FROM CHROMIUM
On 2013/05/31 00:04:41, vcarbune.chromium wrote: > On 2013/05/31 00:01:43, acolwell wrote: > > On 2013/05/30 ...
7 years, 6 months ago (2013-05-31 02:13:38 UTC) #10
vcarbune.chromium
On 2013/05/31 02:13:38, acolwell wrote: > On 2013/05/31 00:04:41, vcarbune.chromium wrote: > > On 2013/05/31 ...
7 years, 6 months ago (2013-05-31 13:17:34 UTC) #11
acolwell GONE FROM CHROMIUM
On 2013/05/31 13:17:34, vcarbune.chromium wrote: > Shortly, resuming the options that can fix the problem ...
7 years, 6 months ago (2013-05-31 22:54:20 UTC) #12
vcarbune.chromium
On 2013/05/31 22:54:20, acolwell wrote: > On 2013/05/31 13:17:34, vcarbune.chromium wrote: > > Shortly, resuming ...
7 years, 6 months ago (2013-06-01 10:49:02 UTC) #13
acolwell GONE FROM CHROMIUM
On 2013/06/01 10:49:02, vcarbune.chromium wrote: > Thank you for taking the time and looking through ...
7 years, 6 months ago (2013-06-01 16:47:09 UTC) #14
inferno
lgtm
7 years, 6 months ago (2013-06-01 17:52:54 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vcarbune@chromium.org/15739014/15001
7 years, 6 months ago (2013-06-02 18:48:37 UTC) #16
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-02 18:59:09 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vcarbune@chromium.org/15739014/30001
7 years, 6 months ago (2013-06-03 04:12:03 UTC) #18
inferno
On 2013/06/02 18:59:09, I haz the power (commit-bot) wrote: > Sorry for I got bad ...
7 years, 6 months ago (2013-06-03 04:13:03 UTC) #19
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=8327
7 years, 6 months ago (2013-06-03 05:42:36 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vcarbune@chromium.org/15739014/30001
7 years, 6 months ago (2013-06-03 06:25:29 UTC) #21
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=8344
7 years, 6 months ago (2013-06-03 07:45:00 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vcarbune@chromium.org/15739014/30001
7 years, 6 months ago (2013-06-03 15:38:09 UTC) #23
aarya
https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp#newcode294 Source/core/html/HTMLMediaElement.cpp:294: m_asyncEventQueue.close(); This line was a compile failure, that is ...
7 years, 6 months ago (2013-06-03 16:47:26 UTC) #24
aarya
On 2013/06/03 16:47:26, aarya wrote: > https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp > File Source/core/html/HTMLMediaElement.cpp (right): > > https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp#newcode294 > ...
7 years, 6 months ago (2013-06-03 17:12:53 UTC) #25
vcarbune.chromium
https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/15739014/diff/49002/Source/core/html/HTMLMediaElement.cpp#newcode294 Source/core/html/HTMLMediaElement.cpp:294: m_asyncEventQueue.close(); On 2013/06/03 16:47:26, aarya wrote: > This line ...
7 years, 6 months ago (2013-06-03 17:24:22 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vcarbune@chromium.org/15739014/28002
7 years, 6 months ago (2013-06-03 19:11:17 UTC) #27
commit-bot: I haz the power
7 years, 6 months ago (2013-06-03 23:32:34 UTC) #28
Message was sent while issue was closed.
Change committed as 151692

Powered by Google App Engine
This is Rietveld 408576698