Commit a5f28b41 authored by glider@chromium.org's avatar glider@chromium.org

Do not read /proc/self/exe before forking if Chrome is ran under Valgrind.

This should prevent ui_tests from crashing under Valgrind on Linux.
This fix was suggested by kcc (see the discussion of issue 28439)

BUG=28439

Review URL: http://codereview.chromium.org/6331002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71590 0039d316-1c4b-4281-b951-d872f2087c98
parent 6532c67c
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "chrome/common/child_process_info.h" #include "chrome/common/child_process_info.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_paths_internal.h"
...@@ -56,7 +57,10 @@ FilePath ChildProcessHost::GetChildPath(bool allow_self) { ...@@ -56,7 +57,10 @@ FilePath ChildProcessHost::GetChildPath(bool allow_self) {
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Use /proc/self/exe rather than our known binary path so updates // Use /proc/self/exe rather than our known binary path so updates
// can't swap out the binary from underneath us. // can't swap out the binary from underneath us.
if (allow_self) // When running under Valgrind, forking /proc/self/exe ends up forking the
// Valgrind executable, which then crashes. However, it's almost safe to
// assume that the updates won't happen while testing with Valgrind tools.
if (allow_self && !RunningOnValgrind())
return FilePath("/proc/self/exe"); return FilePath("/proc/self/exe");
#endif #endif
......
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