summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 10:32:05 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 10:32:05 +0000
commitd75f16b227577597a35977e6871147b2f5aefbed (patch)
tree1afa1fd8a692f82db17759de8975060ff2205c6f /chrome
parent60c7d526f362bc2b478e019505ad8a9a8d7dd00a (diff)
downloadchromium_src-d75f16b227577597a35977e6871147b2f5aefbed.zip
chromium_src-d75f16b227577597a35977e6871147b2f5aefbed.tar.gz
chromium_src-d75f16b227577597a35977e6871147b2f5aefbed.tar.bz2
Add some temporary instrumentation to help track down a crasher.
BUG=40447 TBR=huanr Review URL: http://codereview.chromium.org/1585019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/child_process_launcher.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/child_process_launcher.cc b/chrome/browser/child_process_launcher.cc
index 206d8a7..534368b 100644
--- a/chrome/browser/child_process_launcher.cc
+++ b/chrome/browser/child_process_launcher.cc
@@ -31,6 +31,32 @@
#include "base/global_descriptors_posix.h"
#endif
+// TODO(eroman): Debugging helper to make strings show up in mini-dumps.
+// Remove after done investigating 40447.
+class StackString {
+ public:
+ explicit StackString(const std::wstring& str) {
+ length_ = str.size();
+ memcpy(&buffer_[0], str.data(),
+ std::min(sizeof(wchar_t) * str.length(),
+ sizeof(buffer_)));
+ }
+
+ std::wstring ToString() {
+ return std::wstring(buffer_, length_);
+ }
+
+ ~StackString() {
+ // Hack to make sure compiler doesn't optimize us away.
+ if (ToString() != ToString())
+ LOG(INFO) << ToString();
+ }
+
+ private:
+ wchar_t buffer_[128];
+ size_t length_;
+};
+
// Having the functionality of ChildProcessLauncher be in an internal
// ref counted object allows us to automatically terminate the process when the
// parent class destructs, while still holding on to state that we need.
@@ -101,6 +127,11 @@ class ChildProcessLauncher::Context
scoped_ptr<CommandLine> cmd_line_deleter(cmd_line);
base::ProcessHandle handle = base::kNullProcessHandle;
#if defined(OS_WIN)
+ // TODO(eroman): Remove after done investigating 40447.
+ StackString stack_command_line(cmd_line->command_line_string());
+ // This line might crash, since it calls the string copy-constructor:
+ StackString stack_program(cmd_line->program());
+
handle = sandbox::StartProcessWithAccess(cmd_line, exposed_dir);
#elif defined(OS_POSIX)