Skip to content

Commit

Permalink
[OS/2] ipc: Disable SCM_RIGHTS usage.
Browse files Browse the repository at this point in the history
This fixes 100% CPU hangs when doing IPC. See #106. Note that the
current IPC implementation doesn't allow to pass open streams between
processes on OS/2 so some functionality may not work (in particular,
handling web content in child processes). This commit adds a temporary
runtime abort that will get triggered if this functionality is requested.
Issue #42 tracks its implementation task.
  • Loading branch information
dmik committed Jun 28, 2017
1 parent 23ed8e9 commit 87d0a89
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ipc/chromium/src/chrome/common/ipc_channel_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,17 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {

msg.msg_iov = &iov;
msg.msg_iovlen = 1;
#ifdef OS_OS2
// OS/2 TCP/IP does not use ancillary data fields of msghdr and recvmsg()
// leaves them untouched so keep them 0 to avoid parsing garbage later.
#else
msg.msg_control = input_cmsg_buf_;
#endif

for (;;) {
#ifndef OS_OS2
msg.msg_controllen = sizeof(input_cmsg_buf_);
#endif

if (bytes_read == 0) {
if (pipe_ == -1)
Expand Down Expand Up @@ -696,6 +703,9 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() {

if (message_send_bytes_written_ == 0 &&
!msg->file_descriptor_set()->empty()) {
#ifdef OS_OS2
NS_RUNTIMEABORT("No SCM_RIGHTS support on OS/2!");
#endif
// This is the first chunk of a message which has descriptors to send
struct cmsghdr *cmsg;
const unsigned num_fds = msg->file_descriptor_set()->size();
Expand Down

0 comments on commit 87d0a89

Please sign in to comment.