From 9f816f720d145872fa7ad141bfe63ea090f3840f Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Tue, 16 Mar 2010 20:31:10 +0000 Subject: The plugin channel host in the renderer process should not initialize IPC using a known-closed channel name. Instead, when the channel name is known to be closed, initialization should fail. On POSIX systems, the channel is created by the plugin channel in the plugin process and shared with the renderer process over IPC. If the channel closes, the renderer process must not attempt to reestablish it; the plugin process must do that. This serves as early detection for and an escape from the assertion that causes renderers to die and be replaced by a sad tab when attempting to open multiple pages with plugins simultaneously. This resolves the Mac renderer top crash. BUG=26754 TEST=Test case from bug 26754 comment 9 (affected Macs only): a. Have lots of bookmarks (import Safari defaults) b. Right-click on bookmark bar, and choose "Open All Bookmarks" Expect: no crash, no sad tabs. This test should be repeated many times. Review URL: http://codereview.chromium.org/984004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41755 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_channel_posix.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ipc/ipc_channel_posix.cc') diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 545ad0c..f6b19f7 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -299,6 +299,11 @@ void RemoveAndCloseChannelSocket(const std::string& name) { } // static +bool ChannelSocketExists(const std::string& name) { + return Singleton()->Lookup(name) != -1; +} + +// static bool SocketPair(int* fd1, int* fd2) { int pipe_fds[2]; if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) { @@ -362,7 +367,8 @@ bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id, // initial channel must not be recycled here. http://crbug.com/26754. static bool used_initial_channel = false; if (used_initial_channel) { - LOG(FATAL) << "Denying attempt to reuse initial IPC channel"; + LOG(FATAL) << "Denying attempt to reuse initial IPC channel for " + << pipe_name_; return false; } used_initial_channel = true; -- cgit v1.1