summaryrefslogtreecommitdiffstats
path: root/content/zygote
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 13:57:42 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 13:57:42 +0000
commitff85797d6caefda6a04514fa749a2a8c8757e920 (patch)
tree82138b775adb9329b4a8b944828fe541845b7ba2 /content/zygote
parent9d5f360501bf2c76c86ed009a293a3febe82b6bb (diff)
downloadchromium_src-ff85797d6caefda6a04514fa749a2a8c8757e920.zip
chromium_src-ff85797d6caefda6a04514fa749a2a8c8757e920.tar.gz
chromium_src-ff85797d6caefda6a04514fa749a2a8c8757e920.tar.bz2
Do not call base::EnsureProcessTerminated() from the zygote process under TSan
to avoid spawning threads before fork(). This is a temporary workaround for bug 274855. BUG=274855 R=jln@chromium.org Review URL: https://codereview.chromium.org/223403007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/zygote')
-rw-r--r--content/zygote/zygote_linux.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 518b7e4..8ea9714 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -192,8 +192,21 @@ void Zygote::HandleReapRequest(int fd,
}
if (!child_info.started_from_helper) {
+ // Do not call base::EnsureProcessTerminated() under ThreadSanitizer, as it
+ // spawns a separate thread which may live until the call to fork() in the
+ // zygote. As a result, ThreadSanitizer will report an error and almost
+ // disable race detection in the child process.
+ // Not calling EnsureProcessTerminated() may result in zombie processes
+ // sticking around. This will only happen during testing, so we can live
+ // with this for now.
+#if !defined(THREAD_SANITIZER)
// TODO(jln): this old code is completely broken. See crbug.com/274855.
base::EnsureProcessTerminated(child_info.internal_pid);
+#else
+ LOG(WARNING) << "Zygote process omitting a call to "
+ << "base::EnsureProcessTerminated() for child pid " << child
+ << " under ThreadSanitizer. See http://crbug.com/274855.";
+#endif
} else {
// For processes from the helper, send a GetTerminationStatus request
// with known_dead set to true.