summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:41:45 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:41:45 +0000
commit5b84a98f6572628008f0b332c7dd1ced676621ba (patch)
tree6e85c5d2c4ed9d43e29b1c99bba5cb2527d24021 /base/file_util.h
parent7e820a1295d98bbf7ab1b14e43d9805b86c15999 (diff)
downloadchromium_src-5b84a98f6572628008f0b332c7dd1ced676621ba.zip
chromium_src-5b84a98f6572628008f0b332c7dd1ced676621ba.tar.gz
chromium_src-5b84a98f6572628008f0b332c7dd1ced676621ba.tar.bz2
Kernel zombie death race!
Harden process_watcher_mac against zombie-admitting holes. A race between the application and the kernel exists in that a process stops being kqueueable before it becomes waitable. If ProcessWatcher::EnsureProcessTerminated was called within this window, it would assume that the process had already been reaped. The process would then become waitable, but by then, the application forgot about it, and it would be leaked as a zombie until the application as a whole was quit. In order to kill the undead, this code now detects not-kqueueable not-waitable processes and does a blocking wait, with a kill thrown in for good measure. Other opportunities for this code to return early without making the best effort to kill the process have been plugged up too. If any of the kqueue operations fail, this will now fall through to kill and wait for the process. BUG=43150, 43244 TEST=A. Steps from bug 43150 comment 8: 1. Clean profile. 2. Launch. The home page, http://www.google.com/, will load. 3. Type (or paste) about:blank into the omnibox. Expect: no zombies. Observe: original renderer process almost always becomes undead. Note: Perform the test multiple times. It's timing-sensitive. I experienced varying degrees of success reproducing zombies when launching the app by double-clicking it, running it from a terminal window with stdout and stderr on the terminal, and running it from a terminal window with stdout and stderr redirected to a file. With this fix, no zombies should be condition. B. zombies.py test from bug 43244. Review URL: http://codereview.chromium.org/1915003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
0 files changed, 0 insertions, 0 deletions