summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authoryoichio <yoichio@chromium.org>2015-01-26 20:16:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-27 04:21:14 +0000
commitb83c03c7b691914a054abaab13fb9131b4e0152b (patch)
treeef8874ad134a647f139a15cc10f100090d87dff6 /ipc
parentaf01416ada7b968c55224be9e61272ad73e59fe1 (diff)
downloadchromium_src-b83c03c7b691914a054abaab13fb9131b4e0152b.zip
chromium_src-b83c03c7b691914a054abaab13fb9131b4e0152b.tar.gz
chromium_src-b83c03c7b691914a054abaab13fb9131b4e0152b.tar.bz2
Revert of Add ChannelPosix::ResetSafely() to deal with a lingering crash (patchset #1 id:1 of https://codereview.chromium.org/882543002/)
Reason for revert: many ipc test failed. https://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/10036 Original issue's description: > Add ChannelPosix::ResetSafely() to deal with a lingering crash > > The CL [1] tightened the error check too much and revealed > an existing inconsistency and resulted a production crash. > This CL makes a workaround to that crash, turning a PCHECK() > to DPCHECK(). > > [1] https://crrev.com/ce44fef5fd60dd2be5c587d4b084bdcd36adcee4 > > BUG=449233,448245 > R=agl@chromium.org,jam@chromium.org > > Committed: https://crrev.com/cf3eae19b456536c5ff8dacf8800ec09f9af4bca > Cr-Commit-Position: refs/heads/master@{#313188} TBR=agl@chromium.org,jam@chromium.org,morrita@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=449233,448245 Review URL: https://codereview.chromium.org/878843002 Cr-Commit-Position: refs/heads/master@{#313226}
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_posix.cc21
-rw-r--r--ipc/ipc_channel_posix.h4
2 files changed, 1 insertions, 24 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index f93a003..c347b15 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -189,7 +189,6 @@ ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
waiting_connect_(true),
message_send_bytes_written_(0),
pipe_name_(channel_handle.name),
- in_dtor_(false),
must_unlink_(false) {
memset(input_cmsg_buf_, 0, sizeof(input_cmsg_buf_));
if (!CreatePipe(channel_handle)) {
@@ -201,7 +200,6 @@ ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
}
ChannelPosix::~ChannelPosix() {
- in_dtor_ = true;
Close();
}
@@ -613,7 +611,7 @@ void ChannelPosix::ResetToAcceptingConnectionState() {
// Unregister libevent for the unix domain socket and close it.
read_watcher_.StopWatchingFileDescriptor();
write_watcher_.StopWatchingFileDescriptor();
- ResetSafely(&pipe_);
+ pipe_.reset();
#if defined(IPC_USES_READWRITE)
fd_pipe_.reset();
remote_fd_pipe_.reset();
@@ -1080,23 +1078,6 @@ base::ProcessId ChannelPosix::GetSelfPID() const {
return GetHelloMessageProcId();
}
-void ChannelPosix::ResetSafely(base::ScopedFD* fd) {
- if (!in_dtor_) {
- fd->reset();
- return;
- }
-
- // crbug.com/449233
- // The CL [1] tightened the error check for closing FDs, but it turned
- // out that there are existing cases that hit the newly added check.
- // ResetSafely() is the workaround for that crash, turning it from
- // from PCHECK() to DPCHECK() so that it doesn't crash in production.
- // [1] https://crrev.com/ce44fef5fd60dd2be5c587d4b084bdcd36adcee4
- int fd_to_close = fd->release();
- if (-1 != fd_to_close)
- DPCHECK(0 == IGNORE_EINTR(close(fd_to_close)));
-}
-
//------------------------------------------------------------------------------
// Channel's methods
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index a65283d..a792afa 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -202,10 +202,6 @@ class IPC_EXPORT ChannelPosix : public Channel,
// implementation!
std::vector<int> input_fds_;
-
- void ResetSafely(base::ScopedFD* fd);
- bool in_dtor_;
-
#if defined(OS_MACOSX)
// On OSX, sent FDs must not be closed until we get an ack.
// Keep track of sent FDs here to make sure the remote is not