You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This CL fixes a crash in Subscriber, which was introduced in
https://crrev.com/c/6221901, when we implemented ref-counted producers.
With ref-counted producers, Subscriber::next()/error()/complete() have
to iterate over the list of internal observers and call the respective
methods on them. However, because these methods can terminate the
subscription for a given observer, the list of internal observers can
mutate while iterating over it, which is unsafe and causes a crash.
This is essentially the implementation version of
whatwg/infra#396.
This CL fixes this bug by taking a copy of the list of internal
observers before iterating over it in each of these methods, so we can
call the methods on each registered observer, while iterating over a
stable vector that cannot be mutated (since it is a copy).
R=masonf
Bug: 40282760
Change-Id: I9ade96a95370120b4c9f7309a78d3222398aed6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6311209
Commit-Queue: Dominic Farolino <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1426289}
0 commit comments