New issue
Advanced search Search tips

Issue 661044 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Nov 2017
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Race on create/access for ContentVerifierIOData for particular extension_id

Reported by akalu...@yandex-team.ru, Nov 1 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 YaBrowser/16.9.1.1192 Safari/537.36

Steps to reproduce the problem:
In ExtensionSystemImpl::Shared::Init ContentVerifier and SharedUserScriptMaster
instances are initialized in the following way:
 - create ContentVerifier
 - create SharedUserScriptMaster (SharedUserScriptMaster subscribes to
   ExtensionRegistry notifications in constructor)
 - start ContentVerifier (ContentVerifier subscribes to ExtensionRegistry
   notifications in ContentVerifier::Start)

Therefore SharedUserScriptMaster instance gets OnExtensionLoaded
notifications before ContentVerifier instance does.

ContentVerifier starts the following call sequence in OnExtensionLoaded method:
 - ContentVerifier::OnExtensionLoaded (UI)
 - ContentVerifier::AddOrReplaceIOData (IO)

SharedUserScriptMaster starts the following call sequence in OnExtensionLoaded
method:
 - SharedScriptUserMaster::OnExtensionLoaded (UI)
 - UserScriptLoader::AddScripts (UI)
 - UserScriptLoader::AttemptLoad (UI)
 - UserScriptLoader::StartLoad (UI)
 - ExtensionUserScriptLoader::LoadScripts (UI)
 - LoadScriptsOnFileThread (FILE)
 - LoadUserScripts (FILE)
 - LoadScriptContent (FILE)
 - VerifyContent (IO)
 - ContentVerifier::CreateJobFor (IO)

ContentVerifier::AddOrReplaceIOData and ContentVerifier::CreateJobFor try
to create/access the same io_data_ element.
As long as SharedScriptUserMaster gets OnExtensionLoaded notification
first, the threads can be scheduled in the way that VerifyContent task will
get posted on IO thread before ContentVerifier::AddOrReplaceIOData task.
(UI thread should be interrupted before call to
ContentVerifier::OnExtensionLoaded, and FILE thread should be run up to
adding VerifyContent task to IO thread)
After that ContentVerifier::CreateJobFor will fail to get
ContentVerifierIOData from io_data_ and exit after if (!data) check.

What is the expected behavior?

What went wrong?

Did this work before? N/A 

Chrome version: 52.0.2743.116  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 23.0 r0
 
Labels: TE-NeedsTriageHelp
Project Member

Comment 2 by sheriffbot@chromium.org, Nov 1 2017

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment