New issue
Advanced search Search tips

Issue 754488 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Chrome iterates through my symbol server cache directory at startup

Project Member Reported by brucedaw...@chromium.org, Aug 10 2017

Issue description

Chrome Version: Version 62.0.3181.0 (Official Build) canary (64-bit)
OS: Windows 10 14393 (Anniversary Edition) on Google work station

What steps will reproduce the problem?
(1) Set a symbol server path in _NT_SYMBOL_PATH, such as set _NT_SYMBOL_PATH=SRV*C:\symbols*https://msdl.microsoft.com/download/symbols;SRV*C:\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com and make sure c:\symbols is populated with lots of directories
(2) Use procmon or ETW to monitor access to c:\symbols
(3) Launch canary

Canary was launched with this command line, from a command prompt with _NT_SYMBOL_PATH set.

"C:\Users\brucedawson\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --user-data-dir=c:\src\temp\profile_03 https://www.dailymotion.com/video/x489k7d_street-performer-shows-off-slinky-skills_fun?autoplay=false

What is the expected result?

No access to c:\symbols

What happens instead?

Most of the files in c:\symbols are enumerated with a total of more than 6,000 4 KiB read operations.

The call stack for the read operations is:

  ntdll.dll!RtlUserThreadStart
  kernel32.dll!BaseThreadInitThunk
  chrome.dll!base::`anonymous namespace'::ThreadFunc
  chrome.dll!base::internal::SchedulerWorker::Thread::ThreadMain
  chrome.dll!base::internal::TaskTracker::RunNextTask
  chrome.dll!base::internal::TaskTracker::PerformRunTask
  chrome.dll!base::debug::TaskAnnotator::RunTask
  chrome.dll!base::`anonymous namespace'::PostTaskAndReplyRelay::RunTaskAndPostReply
  chrome.dll!base::internal::Invoker<base::internal::BindState<void (*)(base::Callback<void (bool), base::internal::CopyMode::MoveOnly, base::internal::RepeatMode::Once>, bool *), base::Callback<void (bool), base::internal::CopyMode::MoveOnly, base::internal::RepeatMode::Once>, base::internal::OwnedWrapper<bool> >, void ()>::RunOnce
  chrome.dll!base::internal::ReturnAsParamAdapter<std::unique_ptr<InstalledPrograms::ProgramsData,std::default_delete<InstalledPrograms::ProgramsData> > >
  chrome.dll!base::internal::Invoker<base::internal::BindState<std::unique_ptr<InstalledPrograms::ProgramsData, std::default_delete<InstalledPrograms::ProgramsData> > (*)(std::unique_ptr<MsiUtil, std::default_delete<MsiUtil> >), std::unique_ptr<MsiUtil, std::default_delete<MsiUtil> > >, std::unique_ptr<InstalledPrograms::ProgramsData, std::default_delete<InstalledPrograms::ProgramsData> > ()>::RunOnce
  chrome.dll!`anonymous namespace'::GetProgramsData
  chrome.dll!MsiUtil::GetMsiComponentPaths
  msi.dll!MsiGetComponentPathW
  msi.dll!GetComponentPathInternal
  msi.dll!_GetComponentPath
  msi.dll!MsiGetFileAttributesEx
  KernelBase.dll!GetFileAttributesExW

Note that some of the crucial functions are inlined and are therefore not visible in the call stack.

The access to c:\symbols could be triggered partially by this code:

https://cs.chromium.org/chromium/src/base/debug/stack_trace_win.cc?rcl=5d0ea383e300bdbd091e262c573f4de49cb3c603&l=49

but ultimately GetProgramsData() seems to be more expensive than expected on some machines, with its execution spanning several seconds (???) on my machine.

ETW traces, such as "2017-08-10_15-42-20 chrome disk IO test third run.etl", available by request.

 
Cc: pmonette@chromium.org
Can you take a look at this? I tried looking in UMA to see how long this function was taking to run but I couldn't find it so maybe the first task is to figure out why it's not showing up in the jank/task profiler, or add explicit UMA measurements.
Cc: -pmonette@chromium.org
Owner: pmonette@chromium.org
Status: Assigned (was: Untriaged)
Assigning - seems worth investigating?
I'll take a look tomorrow. The code in question (chrome/browser/conflicts/installed_programs_win.h) iterates over installed MSI products and their components (components are files installed by the product).

It's possible that I have underestimated the amount of work needed to do just that. The code runs in a sequence with background priority to not overload the machine.
I sent you a code review. Worth noting that the reason it was happening to you is because I suspect you installed your symbols via a Windows Symbol Packages installer.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 11 2017

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

commit b604b4b4270382be245eda4b826bac7ffb82d4fe
Author: Patrick Monette <pmonette@chromium.org>
Date: Fri Aug 11 23:55:52 2017

[ModuleDatabase] Better identify microsoft programs

The publisher check now matches all strings that starts with "Microsoft"
instead of matching exactly "Microsoft Corporation".

Bug:  754488 
Change-Id: I3351b2c53ddba23cf34b63986690e94a23e1e550
Reviewed-on: https://chromium-review.googlesource.com/612453
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493887}
[modify] https://crrev.com/b604b4b4270382be245eda4b826bac7ffb82d4fe/chrome/browser/conflicts/installed_programs_win.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 22 2017

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

commit bd29fbddfb7b6fc21426ae55bb4ee1c68efbac71
Author: Patrick Monette <pmonette@chromium.org>
Date: Tue Aug 22 23:00:42 2017

[ModuleDatabase] Add some metrics related to the installed programs

These metrics will give us a sense of how expensive the GetProgramsData
operation is on our user's machine.

Bug:  754488 
Change-Id: I85d12045fa0de33284f902c844766ece6205071e
Reviewed-on: https://chromium-review.googlesource.com/612504
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Alexei Svitkine (very slow) <asvitkine@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496486}
[modify] https://crrev.com/bd29fbddfb7b6fc21426ae55bb4ee1c68efbac71/chrome/browser/conflicts/installed_programs_win.cc
[modify] https://crrev.com/bd29fbddfb7b6fc21426ae55bb4ee1c68efbac71/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)

Sign in to add a comment