summaryrefslogtreecommitdiffstats
path: root/content/zygote
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-17 03:50:22 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-17 03:50:22 +0000
commit0dac68b42cf4742c6e3d03dfaa14d2aa1ada0ea1 (patch)
tree7cc6e737dc44ce6833e8923cceed4e67294c1092 /content/zygote
parent50412714e3a37f4d5a4aaae3437aef9909db30e2 (diff)
downloadchromium_src-0dac68b42cf4742c6e3d03dfaa14d2aa1ada0ea1.zip
chromium_src-0dac68b42cf4742c6e3d03dfaa14d2aa1ada0ea1.tar.gz
chromium_src-0dac68b42cf4742c6e3d03dfaa14d2aa1ada0ea1.tar.bz2
Fix a bug where killing pages doesn't yield a sad-tab
The determination of whether or not to put up a sad tab page is made based on the termination status of the renderer process. The termination status of the renderer process is checked when the channel between the browser and the renderer stops working. There is a race here because there is no reason to believe that the renderer process has finished terminating at the time that the browser detects that its channel to the renderer is dead. If renderer process is believed to be still running at the moment when the decision to put up the sad tab page is taken, then no sad tab will be put up, the view of the renderer will be removed (eventually), and a transparent window will result. This bug was previously fixed on Linux with with https://chromiumcodereview.appspot.com/11316261 this patch expands that fix to Mac. In particular, if the renderer process is known to be dead, wait for the process to terminate before taking its termination status. To be sure that the browser does not wait forever on a renderer that is not exiting, send a kill signal to the renderer before doing the wait. BUG=167538 Review URL: https://chromiumcodereview.appspot.com/23866011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/zygote')
-rw-r--r--content/zygote/zygote_linux.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 4146f92..08f1ecb 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -223,16 +223,7 @@ bool Zygote::GetTerminationStatus(base::ProcessHandle real_pid,
} else {
// Handle the request directly.
if (known_dead) {
- // If we know that the process is already dead and the kernel is cleaning
- // it up, we do want to wait until it becomes a zombie and not risk
- // returning eroneously that it is still running. However, we do not
- // want to risk a bug where we're told a process is dead when it's not.
- // By sending SIGKILL, we make sure that WaitForTerminationStatus will
- // return quickly even in this case.
- if (kill(child, SIGKILL)) {
- PLOG(ERROR) << "kill (" << child << ")";
- }
- *status = base::WaitForTerminationStatus(child, exit_code);
+ *status = base::GetKnownDeadTerminationStatus(child, exit_code);
} else {
// We don't know if the process is dying, so get its status but don't
// wait.