diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 05:02:17 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 05:02:17 +0000 |
commit | f355c56028d0404855185541c7ba8568c22ed4a3 (patch) | |
tree | 8efc61aef651b72aacc3dd9084b3df0fdbf936d0 | |
parent | 20305ec6f1acf21392c2f3938a14a96f1e28e76d (diff) | |
download | chromium_src-f355c56028d0404855185541c7ba8568c22ed4a3.zip chromium_src-f355c56028d0404855185541c7ba8568c22ed4a3.tar.gz chromium_src-f355c56028d0404855185541c7ba8568c22ed4a3.tar.bz2 |
Make sure the process is _really_ gone after a __debugbreak(). We've had a
few annoying cases where someone has been monitoring Chrome under windbg,
which can skip over __debugbreak() and then show them a scary-looking
access violation.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/6372008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72107 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/debug/debugger_posix.cc | 3 | ||||
-rw-r--r-- | base/debug/debugger_win.cc | 3 | ||||
-rw-r--r-- | chrome/app/chrome_main.cc | 3 | ||||
-rw-r--r-- | chrome/plugin/plugin_main.cc | 4 |
4 files changed, 12 insertions, 1 deletions
diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index b865e65..2eacaf9 100644 --- a/base/debug/debugger_posix.cc +++ b/base/debug/debugger_posix.cc @@ -174,6 +174,9 @@ bool BeingDebugged() { void BreakDebugger() { DEBUG_BREAK(); +#if defined(NDEBUG) + _exit(1); +#endif } } // namespace debug diff --git a/base/debug/debugger_win.cc b/base/debug/debugger_win.cc index 3323b61..b13dbfd 100644 --- a/base/debug/debugger_win.cc +++ b/base/debug/debugger_win.cc @@ -105,6 +105,9 @@ void BreakDebugger() { if (IsDebugUISuppressed()) _exit(1); __debugbreak(); +#if defined(NDEBUG) + _exit(1); +#endif } } // namespace debug diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 6bf80cc..9cd4897 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -137,10 +137,12 @@ void InvalidParameter(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t reserved) { __debugbreak(); + _exit(1); } void PureCall() { __debugbreak(); + _exit(1); } #pragma warning(push) @@ -162,6 +164,7 @@ void OnNoMemory() { // the buffer is then used, it provides a handy mapping of memory starting at // address 0 for an attacker to utilize. __debugbreak(); + _exit(1); } #pragma warning(pop) diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index 0dc0503..4268b0f 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -149,8 +149,10 @@ int PluginMain(const MainFunctionParams& parameters) { BOOL result = run_security_tests(&test_count); DCHECK(result) << "Test number " << test_count << " has failed."; // If we are in release mode, crash or debug the process. - if (!result) + if (!result) { __debugbreak(); + _exit(1); + } } FreeLibrary(sandbox_test_module); |