1. 04 Sep, 2018 1 commit
    • Takashi Sakamoto's avatar
      Revert "Cleanup lifetime handling in P2P sockets." · d31f5b35
      Takashi Sakamoto authored
      This reverts commit e6df6345.
      
      Reason for revert: 
      Suspect WebKit Linux Trusty MSAN failures:
      https://ci.chromium.org/buildbot/chromium.webkit/WebKit%20Linux%20Trusty%20MSAN/9778
      
      crash log for content_shell (pid 19555):
      STDOUT: <empty>
      STDERR: [1:16:0903/135605.516164:ERROR:adm_helpers.cc(73)] Failed to query stereo recording.
      STDERR: CONSOLE WARNING: line 371: The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
      STDERR: ==19555==WARNING: MemorySanitizer: use-of-uninitialized-value
      STDERR:     #0 0x119c0a99 in network::P2PSocketUdp::HandleReadResult(int) ./../../services/network/p2p/socket_udp.cc:231:9
      STDERR:     #1 0x119bf30b in network::P2PSocketUdp::OnRecv(int) ./../../services/network/p2p/socket_udp.cc:202:3
      STDERR:     #2 0xc8cd202 in Run ./../../base/callback.h:99:12
      STDERR:     #3 0xc8cd202 in DoReadCallback ./../../net/socket/udp_socket_posix.cc:690:0
      STDERR:     #4 0xc8cd202 in net::UDPSocketPosix::DidCompleteRead() ./../../net/socket/udp_socket_posix.cc:711:0
      STDERR:     #5 0xc8cc98d in net::UDPSocketPosix::ReadWatcher::OnFileCanReadWithoutBlocking(int) ./../../net/socket/udp_socket_posix.cc:676:14
      STDERR:     #6 0xb3aa2ec4 in base::MessagePumpLibevent::OnLibeventNotification(int, short, void*) ./../../base/message_loop/message_pump_libevent.cc:0:13
      STDERR:     #7 0xb3c2bd6 in event_process_active ./../../base/third_party/libevent/event.c:381:4
      STDERR:     #8 0xb3c2bd6 in event_base_loop ./../../base/third_party/libevent/event.c:521:0
      STDERR:     #9 0xb3aaf3e in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) ./../../base/message_loop/message_pump_libevent.cc:214:5
      STDERR:     #10 0xb12a9ff in base::RunLoop::Run() ./../../base/run_loop.cc:102:14
      STDERR:     #11 0x8655f3e in content::BrowserProcessSubThread::IOThreadRun(base::RunLoop*) ./../../content/browser/browser_process_sub_thread.cc:175:11
      STDERR:     #12 0xb26ea58 in base::Thread::ThreadMain() ./../../base/threading/thread.cc:357:3
      STDERR:     #13 0xb39a887 in base::(anonymous namespace)::ThreadFunc(void*) ./../../base/threading/platform_thread_posix.cc:76:13
      STDERR:     #14 0x7ffa170eb183 in start_thread /build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312:0
      STDERR:     #15 0x7ffa0fa3703c in clone /build/eglibc-ripdx6/eglibc-2.19/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:111:0
      STDERR: 
      STDERR:   Uninitialized value was created by a heap allocation
      STDERR:     #0 0x1ab9a79 in operator new(unsigned long) /b/swarming/w/ir/kitchen-workdir/src/third_party/llvm/compiler-rt/lib/msan/msan_new_delete.cc:46:35
      STDERR:     #1 0x119a51de in network::P2PSocket::Create(network::P2PSocket::Delegate*, mojo::InterfacePtr<network::mojom::P2PSocketClient>, mojo::InterfaceRequest<network::mojom::P2PSocket>, network::P2PSocketType, net::NetLog*, network::ProxyResolvingClientSocketFactory*, network::P2PMessageThrottler*) ./../../services/network/p2p/socket.cc:173:14
      STDERR:     #2 0x1198d68c in network::P2PSocketManager::CreateSocket(network::P2PSocketType, net::IPEndPoint const&, network::P2PPortRange const&, network::P2PHostAndIPEndPoint const&, mojo::InterfacePtr<network::mojom::P2PSocketClient>, mojo::InterfaceRequest<network::mojom::P2PSocket>) ./../../services/network/p2p/socket_manager.cc:294:7
      STDERR:     #3 0x1e6127b in network::mojom::P2PSocketManagerStubDispatch::Accept(network::mojom::P2PSocketManager*, mojo::Message*) ./gen/services/network/public/mojom/p2p.mojom.cc:1105:13
      STDERR:     #4 0x11991146 in network::mojom::P2PSocketManagerStub<mojo::RawPtrImplRefTraits<network::mojom::P2PSocketManager> >::Accept(mojo::Message*) ./gen/services/network/public/mojom/p2p.mojom.h:446:12
      STDERR:     #5 0xb407929 in mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) ./../../mojo/public/cpp/bindings/lib/interface_endpoint_client.cc:423:32
      STDERR:     #6 0xb4056da in mojo::FilterChain::Accept(mojo::Message*) ./../../mojo/public/cpp/bindings/lib/filter_chain.cc:40:17
      STDERR:     #7 0xb421df5 in mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper*, mojo::internal::MultiplexRouter::ClientCallBehavior, base::SequencedTaskRunner*) ./../../mojo/public/cpp/bindings/lib/multiplex_router.cc:869:42
      STDERR:     #8 0xb41f60d in mojo::internal::MultiplexRouter::Accept(mojo::Message*) ./../../mojo/public/cpp/bindings/lib/multiplex_router.cc:590:38
      STDERR:     #9 0xb4056da in mojo::FilterChain::Accept(mojo::Message*) ./../../mojo/public/cpp/bindings/lib/filter_chain.cc:40:17
      STDERR:     #10 0xb3fdbc2 in mojo::Connector::ReadSingleMessage(unsigned int*) ./../../mojo/public/cpp/bindings/lib/connector.cc:457:51
      STDERR:     #11 0xb400300 in mojo::Connector::ReadAllAvailableMessages() ./../../mojo/public/cpp/bindings/lib/connector.cc:486:10
      STDERR:     #12 0xb3e106b in Run ./../../base/callback.h:129:12
      STDERR:     #13 0xb3e106b in mojo::SimpleWatcher::OnHandleReady(int, unsigned int, mojo::HandleSignalsState const&) ./../../mojo/public/cpp/system/simple_watcher.cc:273:0
      STDERR:     #14 0xb3e1a6c in mojo::SimpleWatcher::Context::Notify(unsigned int, MojoHandleSignalsState, unsigned int) ./../../mojo/public/cpp/system/simple_watcher.cc:105:22
      STDERR:     #15 0xb3de578 in mojo::SimpleWatcher::Context::CallNotify(MojoTrapEvent const*) ./../../mojo/public/cpp/system/simple_watcher.cc:55:14
      STDERR:     #16 0x46bbfd7 in mojo::core::WatcherDispatcher::InvokeWatchCallback(unsigned long, unsigned int, mojo::core::HandleSignalsState const&, unsigned int) ./../../mojo/core/watcher_dispatcher.cc:90:3
      STDERR:     #17 0x46b9935 in mojo::core::Watch::InvokeCallback(unsigned int, mojo::core::HandleSignalsState const&, unsigned int) ./../../mojo/core/watch.cc:78:13
      STDERR:     #18 0x46a4715 in mojo::core::RequestContext::~RequestContext() ./../../mojo/core/request_context.cc:72:20
      STDERR:     #19 0x466c618 in mojo::core::NodeChannel::OnChannelMessage(void const*, unsigned long, std::__1::vector<mojo::PlatformHandle, std::__1::allocator<mojo::PlatformHandle> >) ./../../mojo/core/node_channel.cc:695:1
      STDERR:     #20 0x461c6a4 in mojo::core::Channel::OnReadComplete(unsigned long, unsigned long*) ./../../mojo/core/channel.cc:714:18
      STDERR: 
      STDERR: SUMMARY: MemorySanitizer: use-of-uninitialized-value (/b/s/w/ir/out/Release/content_shell+0x119c0a99)
      STDERR: Exiting
      STDERR: [19588:19588:0903/135606.482234:WARNING:x11_util.cc(1391)] X error received: serial 170, error_code 3 (BadWindow), request_code 4, minor_code 0 (Unknown)
      
      Original change's description:
      > Cleanup lifetime handling in P2P sockets.
      > 
      > Several fixes for P2P sockets:
      >  1. P2PSocketTcpBase no longer posts tasks with base::Unretained().
      >  2. Previously P2P sockets were destroyed only in response to Mojo
      >     interfaces errors. They were not destroyed on other error. Fixed
      >     it now.
      >  3. Simplified TCP server socket protocol. Now the accepted socket is
      >     passed directly in IncomingTcpConnection.
      >  4. Updated unittests to verify that P2P sockets are destroyed in
      >     response to errors.
      >  5. Other minor cleanups, particularly moved packet dump logic to
      >     SocketManager and removed some unittests that are not relevant
      >     after migration to mojo.
      > 
      > Bug: 877515,  877514
      > Cq-Include-Trybots: luci.chromium.try:linux_mojo
      > Change-Id: I55276e372185c558667289a1efdfcf0421c3d7bc
      > Reviewed-on: https://chromium-review.googlesource.com/1189083
      > Reviewed-by: Nasko Oskov <nasko@chromium.org>
      > Reviewed-by: John Abd-El-Malek <jam@chromium.org>
      > Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#588430}
      
      TBR=nasko@chromium.org,jam@chromium.org,mmenke@chromium.org,sergeyu@chromium.org
      
      Change-Id: I33bfb1c8127a945df37fd8bf9efda681a739095e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: 877515, 877514
      Cq-Include-Trybots: luci.chromium.try:linux_mojo
      Reviewed-on: https://chromium-review.googlesource.com/1203492Reviewed-by: default avatarTakashi Sakamoto <tasak@google.com>
      Commit-Queue: Takashi Sakamoto <tasak@google.com>
      Cr-Commit-Position: refs/heads/master@{#588440}
      d31f5b35
  2. 03 Sep, 2018 39 commits