diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 07:27:04 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 07:27:04 +0000 |
commit | 1749d14a945c70cf830b7dfc316d65331483f9ab (patch) | |
tree | 80a1f7273ce1eebd9867f168233e9087d3517997 /content/ppapi_plugin | |
parent | 2bb95c0f08a111e5e43fbef5a0e531f70e2f6bbb (diff) | |
download | chromium_src-1749d14a945c70cf830b7dfc316d65331483f9ab.zip chromium_src-1749d14a945c70cf830b7dfc316d65331483f9ab.tar.gz chromium_src-1749d14a945c70cf830b7dfc316d65331483f9ab.tar.bz2 |
Add CHECK on file descriptor in various IPC::ChannelHandle passed in.
Regarding Chromium issues 73355, 95129, 95732, 97285, 103957 and Chromium-os issue 18437, 22372, we suspect the channel handles passed to the renderer have invalid file descriptors (fd). This is supported by the fact that using a channel handle with a valid name but an invalid fd will produce crashes with exactly the same stack trace as reported in these issues. Running out of fd in either the renderer, browser or the other process (GPU, broker, etc) could cause this to happen, but we are not sure if that's the real cause.
Adding check for the fd in various places to help investigate these issues further. We will be able to tell if invalid fd is passed in and if yes, which process generates it. Browser side check is only added for the broker case to limit the scale of bad user experience, while providing enough cases for investigation.
BUG=none
TEST=passed unit tests
Review URL: http://codereview.chromium.org/8735015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index c5f2a6b..0d16f9a 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -303,6 +303,9 @@ bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle, // This ensures this process will be notified when it is closed even if a // connection is not established. handle->socket = base::FileDescriptor(dispatcher->TakeRendererFD(), true); + // Check the validity of fd for bug investigation. Remove after fixed. + // See for details: crbug.com/103957. + CHECK_NE(-1, handle->socket.fd); if (handle->socket.fd == -1) return false; #endif |