From ff85797d6caefda6a04514fa749a2a8c8757e920 Mon Sep 17 00:00:00 2001 From: "glider@chromium.org" Date: Fri, 4 Apr 2014 13:57:42 +0000 Subject: 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 --- content/zygote/zygote_linux.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'content/zygote') 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. -- cgit v1.1