diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 08:31:51 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 08:31:51 +0000 |
commit | c7691de3400bc8d62d85c96d41323eee85b85d22 (patch) | |
tree | d7cf9983cb979c0d8638c0a03f7f79f06ef256f3 /content/browser/zygote_host | |
parent | 6296948cd669293abfe7b516fd22b08041f8f4f5 (diff) | |
download | chromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.zip chromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.tar.gz chromium_src-c7691de3400bc8d62d85c96d41323eee85b85d22.tar.bz2 |
Linux: inform the Zygote when it's waiting on a dead process
If the browser calls ProcessDied() and asks the Zygote to wait (without blocking)
on a dead process, the kernel might not be done destroying it and the Zygote may
mistakenly claim that the process is alive.
We now inform the Zygote over the IPC that the process is already dead so
that it can wait synchroneously.
BUG=157458
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11316261
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/zygote_host')
-rw-r--r-- | content/browser/zygote_host/zygote_host_impl_linux.cc | 2 | ||||
-rw-r--r-- | content/browser/zygote_host/zygote_host_impl_linux.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index bbaa32a..308ad5d 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc @@ -451,10 +451,12 @@ void ZygoteHostImpl::EnsureProcessTerminated(pid_t process) { base::TerminationStatus ZygoteHostImpl::GetTerminationStatus( base::ProcessHandle handle, + bool known_dead, int* exit_code) { DCHECK(init_); Pickle pickle; pickle.WriteInt(kZygoteCommandGetTerminationStatus); + pickle.WriteBool(known_dead); pickle.WriteInt(handle); // Set this now to handle the early termination cases. diff --git a/content/browser/zygote_host/zygote_host_impl_linux.h b/content/browser/zygote_host/zygote_host_impl_linux.h index 8a6c778..1872840 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.h +++ b/content/browser/zygote_host/zygote_host_impl_linux.h @@ -37,7 +37,12 @@ class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHost { // Get the termination status (and, optionally, the exit code) of // the process. |exit_code| is set to the exit code of the child // process. (|exit_code| may be NULL.) + // Unfortunately the Zygote can not accurately figure out if a process + // is already dead without waiting synchronously for it. + // |known_dead| should be set to true when we already know that the process + // is dead. base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, + bool known_dead, int* exit_code); // ZygoteHost implementation: |