Commit 17178955 authored by Jesse McKenna's avatar Jesse McKenna Committed by Commit Bot

Disable stack sampling profiler under App Verifier

The StackSamplingProfiler has been observed to cause crashes when
running under Application Verifier, a Windows utility used to detect
subtle programming errors. Samples collected by the
StackSamplingProfiler while Application Verifier is running are unlikely
to hold any value, as Application Verifier slows down execution
significantly.

Because StackSamplingProfiler and Application Verifier are not
compatible, this change detects whether Application Verifier is running,
and does not start up StackSamplingProfiler if so.

This is not expected to impact data collection, as Application Verifier
is used only by a few developers.

Bug: 1004989
Change-Id: I014b3cee440e99d832ae8d84a03fe70777676a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783735
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700356}
parent 94cf2c1a
......@@ -15,6 +15,10 @@
#include "content/public/common/content_switches.h"
#include "extensions/buildflags/buildflags.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
#endif
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#endif
......@@ -189,6 +193,13 @@ StackSamplingConfiguration::GenerateConfiguration() {
if (!IsProfilerSupported())
return PROFILE_DISABLED;
#if defined(OS_WIN)
// Do not start the profiler when Application Verifier is in use; running them
// simultaneously can cause crashes and has no known use case.
if (GetModuleHandleA(base::win::kApplicationVerifierDllName))
return PROFILE_DISABLED;
#endif
switch (chrome::GetChannel()) {
// Enable the profiler unconditionally for development/waterfall builds.
case version_info::Channel::UNKNOWN:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment