New issue
Advanced search Search tips

Issue 717596 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Assert in PermissionsData::PolicyBlockedHostsUnsafe()

Project Member Reported by sorin@chromium.org, May 2 2017

Issue description

I got this assert with a local, tip of the tree build, at commit 03ec5b7ac64e08b079a550314ab78443d4c5a59e.

The code that asserts is:

const URLPatternSet& PermissionsData::PolicyBlockedHostsUnsafe() const {
  DCHECK(!thread_checker_ || thread_checker_->CalledOnValidThread());

In this case, the thread_checker_ object is bound to the thread id 23644, which is "Worker Thread	CrBrowserMain". However, the thread executing code is
the thread id 21592 "Worker Thread	Chrome_IOThread"

Please see the stack trace below:

 	base.dll!base::debug::BreakDebugger() Line 21	C++
 	base.dll!logging::LogMessage::~LogMessage() Line 786	C++
>	chrome.dll!extensions::PermissionsData::PolicyBlockedHostsUnsafe() Line 162	C++
 	chrome.dll!extensions::PermissionsData::IsRuntimeBlockedHost(const GURL & url) Line 419	C++
 	chrome.dll!extensions::PermissionsData::CanRunOnPage(const extensions::Extension * extension, const GURL & document_url, int tab_id, const extensions::URLPatternSet & permitted_url_patterns, const extensions::URLPatternSet & withheld_url_patterns, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * error) Line 435	C++
 	chrome.dll!extensions::PermissionsData::GetPageAccess(const extensions::Extension * extension, const GURL & document_url, int tab_id, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * error) Line 340	C++
 	chrome.dll!WebRequestPermissions::CanExtensionAccessURL(const extensions::InfoMap * extension_info_map, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & extension_id, const GURL & url, int tab_id, bool crosses_incognito, WebRequestPermissions::HostPermissionsCheck host_permissions_check) Line 164	C++
 	chrome.dll!extensions::ExtensionWebRequestEventRouter::GetMatchingListenersImpl(void * browser_context, const net::URLRequest * request, const extensions::InfoMap * extension_info_map, extensions::ExtensionNavigationUIData * navigation_ui_data, bool crosses_incognito, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & event_name, const GURL & url, int render_process_host_id, int routing_id, extensions::WebRequestResourceType resource_type, bool is_async_request, bool is_request_from_extension, int * extra_info_spec, std::vector<extensions::ExtensionWebRequestEventRouter::EventListener *,std::allocator<extensions::ExtensionWebRequestEventRouter::EventListener *> > * matching_listeners) Line 1495	C++
 	chrome.dll!extensions::ExtensionWebRequestEventRouter::GetMatchingListeners(void * browser_context, const extensions::InfoMap * extension_info_map, extensions::ExtensionNavigationUIData * navigation_ui_data, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & event_name, const net::URLRequest * request, int * extra_info_spec) Line 1567	C++
 	chrome.dll!extensions::ExtensionWebRequestEventRouter::OnErrorOccurred(void * browser_context, const extensions::InfoMap * extension_info_map, net::URLRequest * request, bool started, int net_error) Line 1042	C++
 	chrome.dll!`anonymous namespace'::ChromeExtensionsNetworkDelegateImpl::OnCompleted(net::URLRequest * request, bool started, int net_error) Line 281	C++
 	chrome.dll!ChromeNetworkDelegate::OnCompleted(net::URLRequest * request, bool started, int net_error) Line 379	C++
 	net.dll!net::NetworkDelegate::NotifyCompleted(net::URLRequest * request, bool started, int net_error) Line 121	C++
 	net.dll!net::LayeredNetworkDelegate::OnCompleted(net::URLRequest * request, bool started, int net_error) Line 140	C++
 	net.dll!net::NetworkDelegate::NotifyCompleted(net::URLRequest * request, bool started, int net_error) Line 121	C++
 	net.dll!net::LayeredNetworkDelegate::OnCompleted(net::URLRequest * request, bool started, int net_error) Line 140	C++
 	net.dll!net::NetworkDelegate::NotifyCompleted(net::URLRequest * request, bool started, int net_error) Line 121	C++
 	net.dll!net::URLRequest::NotifyRequestCompleted() Line 1193	C++
 	net.dll!net::URLRequest::DoCancel(int error, const net::SSLInfo & ssl_info) Line 741	C++
 	net.dll!net::URLRequest::CancelWithError(int error) Line 695	C++
 	net.dll!net::URLFetcherCore::CancelURLRequest(int error) Line 691	C++
 	net.dll!base::internal::FunctorTraits<void (__cdecl net::URLFetcherCore::*)(int) __ptr64,void>::Invoke<scoped_refptr<net::URLFetcherCore> const & __ptr64,enum net::Error const & __ptr64>(void(net::URLFetcherCore::*)(int) method, const scoped_refptr<net::URLFetcherCore> & receiver_ptr, const net::Error & <args_0>) Line 215	C++
 	net.dll!base::internal::InvokeHelper<0,void>::MakeItSo<void (__cdecl net::URLFetcherCore::*const & __ptr64)(int) __ptr64,scoped_refptr<net::URLFetcherCore> const & __ptr64,enum net::Error const & __ptr64>(void(net::URLFetcherCore::*)(int) & functor, const scoped_refptr<net::URLFetcherCore> & <args_0>, const net::Error & <args_1>) Line 287	C++
 	net.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(int) __ptr64,scoped_refptr<net::URLFetcherCore>,enum net::Error>,void __cdecl(void)>::RunImpl<void (__cdecl net::URLFetcherCore::*const & __ptr64)(int) __ptr64,std::tuple<scoped_refptr<net::URLFetcherCore>,enum net::Error> const & __ptr64,0,1>(void(net::URLFetcherCore::*)(int) & functor, const std::tuple<scoped_refptr<net::URLFetcherCore>,enum net::Error> & bound, base::IndexSequence<0,1> __formal) Line 365	C++
 	net.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(int) __ptr64,scoped_refptr<net::URLFetcherCore>,enum net::Error>,void __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 343	C++
 	base.dll!base::Callback<void __cdecl(void),0,0>::Run() Line 91	C++
 	base.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, base::PendingTask * pending_task) Line 61	C++
 	base.dll!base::MessageLoop::RunTask(base::PendingTask * pending_task) Line 424	C++
 	base.dll!base::MessageLoop::DeferOrRunPendingTask(base::PendingTask pending_task) Line 437	C++
 	base.dll!base::MessageLoop::DoWork() Line 527	C++
 	base.dll!base::MessagePumpForIO::DoRunLoop() Line 475	C++
 	base.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 58	C++
 	base.dll!base::MessageLoop::RunHandler() Line 388	C++
 	base.dll!base::RunLoop::Run() Line 38	C++
 	base.dll!base::Thread::Run(base::RunLoop * run_loop) Line 251	C++
 	content.dll!content::BrowserThreadImpl::IOThreadRun(base::RunLoop * run_loop) Line 279	C++
 	content.dll!content::BrowserThreadImpl::Run(base::RunLoop * run_loop) Line 313	C++
 	base.dll!base::Thread::ThreadMain() Line 336	C++
 	base.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 91	C++
 	[External Code]	

 

Comment 1 by sorin@chromium.org, May 2 2017

It is possible this triggers when starting the browser on a clean profile and the user starts typing in the omnibox.
Owner: nrpeter@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by vakh@chromium.org, May 9 2017

I got this assert with an existing profile, without any user interaction. I did start Chrome with URL: http://testsafebrowsing.appspot.com/

Comment 4 by nrpeter@google.com, May 9 2017

Thanks, I'll look into this.

Comment 5 by nrpeter@google.com, May 11 2017

I was able to reproduce this locally, will update when I have a patch.

Comment 6 by nrpeter@google.com, May 12 2017

Fix coming soon (2873133006) once I get LGTM from owners.
Project Member

Comment 7 by bugdroid1@chromium.org, May 15 2017

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

commit f30da9cab0d5c860219ac2c1863bdd0202690bc4
Author: nrpeter <nrpeter@google.com>
Date: Mon May 15 16:49:56 2017

Removed unecessary thread owner check. We just care about whether the lock was acquired.

BUG= 717596 

Review-Url: https://codereview.chromium.org/2873133006
Cr-Commit-Position: refs/heads/master@{#471800}

[modify] https://crrev.com/f30da9cab0d5c860219ac2c1863bdd0202690bc4/extensions/common/permissions/permissions_data.cc

Comment 8 by nrpeter@google.com, May 22 2017

Status: Fixed (was: Assigned)

Sign in to add a comment