mojo channel fd leaks
Reported by
zk562.st...@sina.com,
Nov 23 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Steps to reproduce the problem:
1. Server side creates mojo channel which contains a listened handle;
2. Client side connects the mojo channel;
3. Server side accept connection and handle status changed into accepted;
4. The new accept fd will be moved into listened fd;
5. The listened fd will be leaked.
What is the expected behavior?
close the listened fd before moving operation.
What went wrong?
listened fd leaked
mojo/edk/system/channel_posix.cc
OnFileCanReadWithoutBlocking() {
handle_ = std::move(accept_fd);
}
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 62.0.3202.94 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
add reset into ScopedPlatformHandle& operator=(ScopedPlatformHandle&& other)
,
Nov 30 2017
,
Nov 30 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0cdbf3eeab5ca5a9f387b7f2859a091c06e5b6c0 commit 0cdbf3eeab5ca5a9f387b7f2859a091c06e5b6c0 Author: Yuzhu Shen <yzshen@chromium.org> Date: Thu Nov 30 23:34:28 2017 Fix assignment operator of ScopedPlatformHandle. The previous code leaks the original handle. BUG= 788068 Change-Id: If6674b1b72b3a4b3e065e541c8ab2f4f20318298 Reviewed-on: https://chromium-review.googlesource.com/801234 Commit-Queue: Yuzhu Shen <yzshen@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Cr-Commit-Position: refs/heads/master@{#520745} [modify] https://crrev.com/0cdbf3eeab5ca5a9f387b7f2859a091c06e5b6c0/mojo/edk/embedder/scoped_platform_handle.h
,
Nov 30 2017
Thanks a lot for the report!
,
Dec 1 2017
We should merge this to M64; as part of issue 753541 we just landed a change to make greater use of ScopedPlatformHandle, where previously we used raw PlatformHandles, so I expect this may have more impact now.
,
Dec 1 2017
It seems we haven't branch M64. So if the change you mentioned in #5 doesn't get merged to earlier versions, we should be fine. Thanks for the context information! |
||||
►
Sign in to add a comment |
||||
Comment 1 by vamshi.k...@techmahindra.com
, Nov 27 2017Components: Internals>Mojo
Labels: Triaged-ET TE-Needs-TriageHelp Needs-Triage-M62