New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 811226 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Data race in base::internal::WeakReferenceOwner::GetRef

Project Member Reported by ClusterFuzz, Feb 12 2018

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=4997194483236864

Fuzzer: ifratric-browserfuzzer-v3
Job Type: linux_tsan_chrome_mp
Platform Id: linux

Crash Type: Data race READ 8
Crash Address: 0x7b50000077e0
Crash State:
  base::internal::WeakReferenceOwner::GetRef
  media_router::CastMediaSinkServiceImpl::OpenChannelsWithRandomizedDelay
  base::internal::Invoker<base::internal::BindState<void
  
Sanitizer: thread (TSAN)

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=4997194483236864

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for more information.
 
Cc: imch...@chromium.org brajkumar@chromium.org
Components: Blink>PresentationAPI
Labels: M-65 Test-Predator-Wrong CF-NeedsTriage
Unable to find the suspect through code search and also from the provided CL, hence cc'ing to @imcheng who have worked on similar  issue 810676  recently .

imcheng@ Could you please take a look in to this issue?

Thanks!
Owner: imch...@chromium.org
Status: Assigned (was: Untriaged)
Similar to  issue 810676 , we are calling WeakPtrFactory::GetWeakPtr on both UI and IO threads, which causes the race condition. The solution is to instantiate a 
WeakPtr on construction and it on both threads.
Project Member

Comment 3 by bugdroid1@chromium.org, Feb 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd6b757d953001eae759c4786b5afe9c7e00916f

commit cd6b757d953001eae759c4786b5afe9c7e00916f
Author: Derek Cheng <imcheng@chromium.org>
Date: Wed Feb 21 20:15:23 2018

[Media Router] Fix URLRequestContext leak and race condition.

Remove usage of SystemURLRequestContextGetter which has led to several
issues including shutdown leak and test setup problems. This means 2
things:
- No more NetLog for DIAL and Cast sockets (for now. When we switch to
NetworkService we can reconsider adding back support depending on
our needs)
- DIAL device description / app info fetch now replaced with URLLoader
APIs that's part of network service.

The race condition issue caused by calling CMSSImpl::GetWeakPtr on two
different sequence is fixed by not using a WeakPtr by assuming
CMSSImpl outlives DialMSSImpl, which is true due to their ordering in
DualMediaSinkService. Also removed the PostTask trampoline by assuming
they both run on the same sequence.

Bug:  810676 , 805728 , 698940 , 779892 , 811226 
Change-Id: Ib3ebb4f7f9d3690c952d2ddcbd579bb5d876906e
Reviewed-on: https://chromium-review.googlesource.com/912561
Commit-Queue: Derek Cheng <imcheng@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Bin Zhao <zhaobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538195}
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/extensions/api/dial/dial_api.cc
[add] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/DEPS
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_fetcher.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_fetcher.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_service.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_service.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/device_description_service_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/mojo/media_router_desktop_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/providers/cast/dual_media_sink_service.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/providers/cast/dual_media_sink_service.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/providers/cast/dual_media_sink_service_unittest.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/test/test_helper.cc
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/browser/media/router/test/test_helper.h
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/chrome/test/BUILD.gn
[modify] https://crrev.com/cd6b757d953001eae759c4786b5afe9c7e00916f/components/cast_channel/cast_socket.cc

Status: Fixed (was: Assigned)

Sign in to add a comment