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

Issue 2776473003: Clear out prefinalizer-allocated vector for conservative GC safety. (Closed)

Created:
3 years, 9 months ago by sof
Modified:
3 years, 9 months ago
Reviewers:
oilpan-reviews, haraken
CC:
chromium-reviews, blink-reviews, tommyw+watchlist_chromium.org, kinuko+watch
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Clear out prefinalizer-allocated vector for conservative GC safety. It is unsafe to revive dead objects by creating references to them while in a finalizer, prefinalizer or not. Avoid doing so in MediaStreamSource::setReadyState(), which MediaStreamComponent's prefinalizer may end up running. See associated comment for further details. R=haraken BUG=704234 Review-Url: https://codereview.chromium.org/2776473003 Cr-Commit-Position: refs/heads/master@{#459390} Committed: https://chromium.googlesource.com/chromium/src/+/419fb6f42e0ead5bfc5983fddb6f404f835f05be

Patch Set 1 #

Total comments: 3

Patch Set 2 : improve comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -0 lines) Patch
M third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp View 1 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (13 generated)
sof
please take a look.
3 years, 9 months ago (2017-03-23 16:41:20 UTC) #4
haraken
Nice detective work!! Thanks for looking into this. A couple of thoughts: - Would it ...
3 years, 9 months ago (2017-03-24 01:24:29 UTC) #8
sof
On 2017/03/24 01:24:29, haraken wrote: > Nice detective work!! Thanks for looking into this. > ...
3 years, 9 months ago (2017-03-24 04:46:57 UTC) #9
haraken
This CL LGTM I want to think about a way to detect an object graph ...
3 years, 9 months ago (2017-03-24 04:58:43 UTC) #10
sof
https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp File third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp (right): https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp#newcode76 third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp:76: for (size_t i = 0; i < observers.size(); ++i) ...
3 years, 9 months ago (2017-03-24 05:03:25 UTC) #11
haraken
On 2017/03/24 05:03:25, sof wrote: > https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp > File third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp > (right): > > https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp#newcode76 ...
3 years, 9 months ago (2017-03-24 05:04:49 UTC) #12
sof
On 2017/03/24 04:58:43, haraken wrote: > This CL LGTM > > I want to think ...
3 years, 9 months ago (2017-03-24 07:37:06 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2776473003/20001
3 years, 9 months ago (2017-03-24 07:39:48 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/415869)
3 years, 9 months ago (2017-03-24 08:13:57 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2776473003/20001
3 years, 9 months ago (2017-03-24 10:07:38 UTC) #21
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/419fb6f42e0ead5bfc5983fddb6f404f835f05be
3 years, 9 months ago (2017-03-24 11:35:46 UTC) #24
sof
3 years, 9 months ago (2017-03-25 12:28:27 UTC) #25
Message was sent while issue was closed.
On 2017/03/24 05:04:49, haraken wrote:
> On 2017/03/24 05:03:25, sof wrote:
> >
>
https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/p...
> > File third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp
> > (right):
> > 
> >
>
https://codereview.chromium.org/2776473003/diff/1/third_party/WebKit/Source/p...
> > third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp:76: for
> > (size_t i = 0; i < observers.size(); ++i)
> > On 2017/03/24 04:58:43, haraken wrote:
> > > 
> > > Can we just call observers.clear()?
> > 
> > We need to clear the backing store contents, not what points to it.
> 
> ah, you're right.

clear()ing would have made the bug much less likely though (no longer directly
reachable should the stack frame memory region be reused), but not impossible.

Powered by Google App Engine
This is Rietveld 408576698