Commit 8c72dfe7 authored by tonyg@chromium.org's avatar tonyg@chromium.org

Revert of Experimentally disable termination on heap corrruption in order to...

Revert of Experimentally disable termination on heap corrruption in order to measure the contribution of this… (https://codereview.chromium.org/402723002/)

Reason for revert:
Crashes chromium.perf bots.

	ChildEBP RetAddr  
	0052f9f4 6a47d2ff chrome_69f00000!base::debug::BreakDebugger+0x10
	0052fa64 6a47df08 chrome_69f00000!CheckIsChromeSxSProcess+0x26
	0052fa68 6a47e664 chrome_69f00000!InstallUtil::IsChromeSxSProcess+0x16
	0052fa70 6a47e53b chrome_69f00000!BrowserDistribution::GetSpecificDistribution+0x3b
	0052fa78 6a47bb77 chrome_69f00000!BrowserDistribution::GetDistribution+0x7
	0052fb64 6a47bb2e chrome_69f00000!`anonymous namespace'::GetChromeChannelInternal+0x2c
	0052fb7c 6a2d03f8 chrome_69f00000!GoogleUpdateSettings::GetChromeChannel+0x21
	0052fbe8 6a2cd0d8 chrome_69f00000!chrome::VersionInfo::GetChannel+0x60
	0052fbec 6a2cd1ab chrome_69f00000!`anonymous namespace'::GetBeaconKeyPath+0x5
	0052fc08 6a2cc624 chrome_69f00000!ShouldExperimentallyDisableTerminateOnHeapCorruption+0xe
	0052fc50 0020720b chrome_69f00000!ChromeMain+0x42
	0052fce0 00206c36 chrome!MainDllLoader::Launch+0x15f
	0052fd24 00228c9e chrome!wWinMain+0x5a
	0052fd70 766e338a chrome!__tmainCRTStartup+0xfd
	WARNING: Stack unwind information not available. Following frames may be wrong.
	0052fd7c 76f99f72 kernel32!BaseThreadInitThunk+0x12
	0052fdbc 76f99f45 ntdll!RtlInitializeExceptionChain+0x63
	0052fdd4 00000000 ntdll!RtlInitializeExceptionChain+0x36

Original issue's description:
> Experimentally disable termination on heap corruption in order to measure the contribution of this feature to missing crash reports.
> 
> Because this feature is configured very early in the process lifetime it cannot be directly controlled by a field-trial. Rather, we query the status during a given execution, store that status in the registry, and then query the registry during startup. This means the experiment will only take effect the 2nd time it is executed.
> 
> BUG=394842
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284100

TBR=jochen@chromium.org,brettw@chromium.org,jhawkins@chromium.org,wfh@chromium.org,erikwright@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=394842

Review URL: https://codereview.chromium.org/401913002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284197 0039d316-1c4b-4281-b951-d872f2087c98
parent 0977aa52
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "base/win/win_util.h" #include "base/win/win_util.h"
#include "chrome/common/terminate_on_heap_corruption_experiment_win.h"
#define DLLEXPORT __declspec(dllexport) #define DLLEXPORT __declspec(dllexport)
...@@ -39,9 +38,6 @@ int ChromeMain(int argc, const char** argv) { ...@@ -39,9 +38,6 @@ int ChromeMain(int argc, const char** argv) {
base::win::SetAbortBehaviorForCrashReporting(); base::win::SetAbortBehaviorForCrashReporting();
params.instance = instance; params.instance = instance;
params.sandbox_info = sandbox_info; params.sandbox_info = sandbox_info;
params.enable_termination_on_heap_corruption =
!ShouldExperimentallyDisableTerminateOnHeapCorruption();
#else #else
params.argc = argc; params.argc = argc;
params.argv = argv; params.argv = argv;
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h" #include "chrome/common/chrome_version_info.h"
#include "chrome/common/env_vars.h" #include "chrome/common/env_vars.h"
#include "chrome/common/terminate_on_heap_corruption_experiment_win.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h" #include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/helper.h" #include "chrome/installer/util/helper.h"
...@@ -260,10 +259,6 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() { ...@@ -260,10 +259,6 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() {
base::TimeDelta::FromSeconds(45)); base::TimeDelta::FromSeconds(45));
InitializeChromeElf(); InitializeChromeElf();
// TODO(erikwright): Remove this and the implementation of the experiment by
// August 2014.
InitializeDisableTerminateOnHeapCorruptionExperiment();
} }
// static // static
......
...@@ -211,8 +211,6 @@ ...@@ -211,8 +211,6 @@
'common/spellcheck_result.h', 'common/spellcheck_result.h',
'common/switch_utils.cc', 'common/switch_utils.cc',
'common/switch_utils.h', 'common/switch_utils.h',
'common/terminate_on_heap_corruption_experiment_win.cc',
'common/terminate_on_heap_corruption_experiment_win.h',
'common/tts_messages.h', 'common/tts_messages.h',
'common/tts_utterance_request.cc', 'common/tts_utterance_request.cc',
'common/tts_utterance_request.h', 'common/tts_utterance_request.h',
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/terminate_on_heap_corruption_experiment_win.h"
#include "base/metrics/field_trial.h"
#include "base/win/registry.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_version_info.h"
#if defined(OS_WIN)
#if defined(GOOGLE_CHROME_BUILD)
#define PRODUCT_STRING_PATH L"Google\\Chrome"
#elif defined(CHROMIUM_BUILD)
#define PRODUCT_STRING_PATH L"Chromium"
#else
#error Unknown branding
#endif
#endif // defined(OS_WIN)
namespace {
wchar_t* GetBeaconKeyPath() {
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
return L"SOFTWARE\\" PRODUCT_STRING_PATH
L"\\DisableTerminateOnProcessHeapCorruptionSxs";
}
return L"SOFTWARE\\" PRODUCT_STRING_PATH
L"\\DisableTerminateOnProcessHeapCorruption";
}
} // namespace
bool ShouldExperimentallyDisableTerminateOnHeapCorruption() {
base::win::RegKey regkey(
HKEY_CURRENT_USER, GetBeaconKeyPath(), KEY_QUERY_VALUE);
return regkey.Valid();
}
void InitializeDisableTerminateOnHeapCorruptionExperiment() {
base::win::RegKey regkey(HKEY_CURRENT_USER);
if (base::FieldTrialList::FindFullName("TerminateOnProcessHeapCorruption") ==
"Disabled") {
regkey.CreateKey(GetBeaconKeyPath(), KEY_SET_VALUE);
} else {
regkey.DeleteKey(GetBeaconKeyPath());
}
}
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_TERMINATE_ON_HEAP_CORRUPTION_EXPERIMENT_WIN_H_
#define CHROME_COMMON_TERMINATE_ON_HEAP_CORRUPTION_EXPERIMENT_WIN_H_
bool ShouldExperimentallyDisableTerminateOnHeapCorruption();
void InitializeDisableTerminateOnHeapCorruptionExperiment();
#endif // CHROME_COMMON_TERMINATE_ON_HEAP_CORRUPTION_EXPERIMENT_WIN_H_
...@@ -557,8 +557,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { ...@@ -557,8 +557,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
is_initialized_ = true; is_initialized_ = true;
delegate_ = params.delegate; delegate_ = params.delegate;
if (params.enable_termination_on_heap_corruption) base::EnableTerminationOnHeapCorruption();
base::EnableTerminationOnHeapCorruption();
base::EnableTerminationOnOutOfMemory(); base::EnableTerminationOnOutOfMemory();
// The exit manager is in charge of calling the dtors of singleton objects. // The exit manager is in charge of calling the dtors of singleton objects.
......
...@@ -25,7 +25,6 @@ class ContentMainDelegate; ...@@ -25,7 +25,6 @@ class ContentMainDelegate;
struct ContentMainParams { struct ContentMainParams {
explicit ContentMainParams(ContentMainDelegate* delegate) explicit ContentMainParams(ContentMainDelegate* delegate)
: delegate(delegate), : delegate(delegate),
enable_termination_on_heap_corruption(true),
#if defined(OS_WIN) #if defined(OS_WIN)
instance(NULL), instance(NULL),
sandbox_info(NULL), sandbox_info(NULL),
...@@ -38,8 +37,6 @@ struct ContentMainParams { ...@@ -38,8 +37,6 @@ struct ContentMainParams {
ContentMainDelegate* delegate; ContentMainDelegate* delegate;
bool enable_termination_on_heap_corruption;
#if defined(OS_WIN) #if defined(OS_WIN)
HINSTANCE instance; HINSTANCE instance;
......
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