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

Issue 1885053002: Safely iterate over MediaStreamSource observers. (Closed)

Created:
4 years, 8 months ago by sof
Modified:
4 years, 8 months ago
CC:
chromium-reviews, blink-reviews, kinuko+watch, tommyw+watchlist_chromium.org, mcasas+watch+mediastream_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Safely iterate over MediaStreamSource observers. When changing the ready state of this object, the resultant dispatching of events by its observers may extend the observer set. Take a snapshot of the observers, so as to be able safely iterate over it across additions. R= BUG=602273 Committed: https://crrev.com/bc3ebdc42cd0b29fd770213d02a99a81b84dc69c Cr-Commit-Position: refs/heads/master@{#387243}

Patch Set 1 #

Patch Set 2 : add test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -5 lines) Patch
A third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-observer-iterate-no-crash.html View 1 1 chunk +41 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-observer-iterate-no-crash-expected.txt View 1 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp View 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
sof
please take a look.
4 years, 8 months ago (2016-04-13 20:24:00 UTC) #2
Guido Urdaneta
lgtm
4 years, 8 months ago (2016-04-13 21:19:09 UTC) #3
haraken
LGTM
4 years, 8 months ago (2016-04-14 00:46:46 UTC) #4
haraken
Not related to this CL, would it be possible to add a runtime verification that ...
4 years, 8 months ago (2016-04-14 02:40:42 UTC) #5
sof
On 2016/04/14 02:40:42, haraken wrote: > Not related to this CL, would it be possible ...
4 years, 8 months ago (2016-04-14 05:19:36 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885053002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885053002/20001
4 years, 8 months ago (2016-04-14 05:19:51 UTC) #8
haraken
On 2016/04/14 05:19:36, sof wrote: > On 2016/04/14 02:40:42, haraken wrote: > > Not related ...
4 years, 8 months ago (2016-04-14 05:22:04 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 8 months ago (2016-04-14 05:34:41 UTC) #10
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/bc3ebdc42cd0b29fd770213d02a99a81b84dc69c Cr-Commit-Position: refs/heads/master@{#387243}
4 years, 8 months ago (2016-04-14 05:36:31 UTC) #12
sof
4 years, 8 months ago (2016-04-15 21:45:11 UTC) #13
Message was sent while issue was closed.
On 2016/04/14 05:22:04, haraken wrote:
> On 2016/04/14 05:19:36, sof wrote:
> > On 2016/04/14 02:40:42, haraken wrote:
> > > Not related to this CL, would it be possible to add a runtime verification
> > that
> > > checks that a hash table is not modifiled while an iterator of the hash
> table
> > is
> > > on the stack?
> > 
> > The ASan builds here are running without asserts enabled afaik, but this
could
> > be addressed by adjusting the meaning of HashTable::m_accessForbidden.
> > 
> > We tried to use it for diagnosing some potential
> > access-table-while-deleting-bucket-entry bugs, but that didn't show up
> anything
> > (I need to double check details before saying for sure though.) It could be
> > repurposed, _if_ the current checking for table modifications in the
iterator
> > isn't sufficient. It would give a "better" stack to catch out the hash table
> > modification itself.
> 
> This is exactly what I have in mind :)
> 

I had a go, but while working on https://codereview.chromium.org/1892533003/ I
realized that using iterator stack lifetime to ban hash table modification
doesn't match well with how iterators are actually used (see CL description.)

i.e., it is not a bug to update a hash table while an iterator has access to
that hash table..it only becomes a bug when you attempt to access the iterator
again. Which is what the current modifications tracking achieves.

Powered by Google App Engine
This is Rietveld 408576698