New issue
Advanced search Search tips

Issue 678712 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Windows host crashes when using webrtc protocol

Project Member Reported by sergeyu@chromium.org, Jan 5 2017

Issue description

Host crashes with the following call stack:

(Inline) -------- remoting_core!webrtc::DesktopVector::is_zero [c:\b\build\slave\win\build\src\third_party\webrtc\modules\desktop_capture\desktop_geometry.h @ 27]
01cff390 72d2c7da remoting_core!remoting::protocol::WebrtcVideoStream::OnCaptureResult+0x13 [c:\b\build\slave\win\build\src\remoting\protocol\webrtc_video_stream.cc @ 199]
01cff3a4 72d2a69b remoting_core!remoting::IpcVideoFrameCapturer::OnCaptureResult+0x22 [c:\b\build\slave\win\build\src\remoting\host\ipc_video_frame_capturer.cc @ 42]
01cff3c0 72d2c7b2 remoting_core!remoting::DesktopSessionProxy::CaptureFrame+0x5a [c:\b\build\slave\win\build\src\remoting\host\desktop_session_proxy.cc @ 295]
01cff3cc 72aeff03 remoting_core!remoting::IpcVideoFrameCapturer::Capture+0x14 [c:\b\build\slave\win\build\src\remoting\host\ipc_video_frame_capturer.cc @ 34]
01cff3f0 72af8b33 remoting_core!remoting::protocol::WebrtcVideoStream::CaptureNextFrame+0x83 [c:\b\build\slave\win\build\src\remoting\protocol\webrtc_video_stream.cc @ 248]
(Inline) -------- remoting_core!base::internal::RunMixin<base::Callback<void __cdecl(void),1,1> >::Run+0x5 [c:\b\build\slave\win\build\src\base\callback.h @ 64]
01cff40c 725ac91f remoting_core!remoting::protocol::WebrtcFrameSchedulerSimple::CaptureNextFrame+0x2d [c:\b\build\slave\win\build\src\remoting\protocol\webrtc_frame_scheduler_simple.cc @ 185]
(Inline) -------- remoting_core!base::Timer::RunScheduledTask+0xaf [c:\b\build\slave\win\build\src\base\callback.h @ 64]
01cff42c 725d4670 remoting_core!base::Timer::RunScheduledTask+0xaf [c:\b\build\slave\win\build\src\base\timer\timer.cc @ 213]
(Inline) -------- remoting_core!base::debug::TaskAnnotator::RunTask+0x180 [c:\b\build\slave\win\build\src\base\callback.h @ 64]
01cff498 7259f868 remoting_core!base::debug::TaskAnnotator::RunTask+0x180 [c:\b\build\slave\win\build\src\base\debug\task_annotator.cc @ 54]
01cffa8c 725a01e8 remoting_core!base::MessageLoop::RunTask+0x328 [c:\b\build\slave\win\build\src\base\message_loop\message_loop.cc @ 406]
(Inline) -------- remoting_core!base::MessageLoop::DeferOrRunPendingTask+0x5c [c:\b\build\slave\win\build\src\base\message_loop\message_loop.cc @ 414]
01cffbe8 725d56bd remoting_core!base::MessageLoop::DoWork+0x388 [c:\b\build\slave\win\build\src\base\message_loop\message_loop.cc @ 513]
01cffcd8 725d4985 remoting_core!base::MessagePumpForIO::DoRunLoop+0xcd [c:\b\build\slave\win\build\src\base\message_loop\message_pump_win.cc @ 732]
01cffd04 725a152c remoting_core!base::MessagePumpWin::Run+0x55 [c:\b\build\slave\win\build\src\base\message_loop\message_pump_win.cc @ 143]
(Inline) -------- remoting_core!base::RunLoop::Run+0x8c [c:\b\build\slave\win\build\src\base\message_loop\message_loop.cc @ 370]
01cffd30 728ecb0d remoting_core!base::RunLoop::Run+0x8c [c:\b\build\slave\win\build\src\base\run_loop.cc @ 36]
01cffee0 725b1107 remoting_core!remoting::AutoThread::ThreadMain+0x10f [c:\b\build\slave\win\build\src\remoting\base\auto_thread.cc @ 230]
01cfff00 75c0336a remoting_core!base::`anonymous namespace'::ThreadFunc+0x87 [c:\b\build\slave\win\build\src\base\threading\platform_thread_win.cc @ 86]
01cfff0c 775a9902 kernel32!BaseThreadInitThunk+0xe
01cfff4c 775a98d5 ntdll!__RtlUserThreadStart+0x70
01cfff64 00000000 ntdll!_RtlUserThreadStart+0x1b
 
Problem is that WebrtcVideoStream::OnCaptureResult() doesn't currently doesn't handle capturer errors and assumes that frame it gets is always valid.

Another related problem is that DesktopDessionProxy returns ERROR_PERMANENT while desktop process is being initialized, which is wrong.
Labels: M-57
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14b918b5e1c3df87e6d509848bce539a8dfef264

commit 14b918b5e1c3df87e6d509848bce539a8dfef264
Author: sergeyu <sergeyu@chromium.org>
Date: Mon Jan 09 23:10:24 2017

Fix WebrtcVideoStream to handle failed capture requests.

DesktopCapturer implementations are allowed to fail Capture() requests.
In that case the caller it supposed to retry later. WebrtcVideoStream
wasn't handling this case properly. On Windows the first Capture()
request often fails because it requires desktop process initialization.
WebrtcFrameScheduler, WebrtcVideoEncoder and their implementations were
also updated to accept nullptr frames, to make it possible to top-off
previous frame, while the capturer keeps failing.

Also updated DesktopSessionProxy to return ERROR_TEMPORARY instead of
ERROR_PERMANENT when the desktop process is not connected.

BUG= 678712 

Review-Url: https://codereview.chromium.org/2616213002
Cr-Commit-Position: refs/heads/master@{#442391}

[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/codec/webrtc_video_encoder.h
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/codec/webrtc_video_encoder_vpx.cc
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/codec/webrtc_video_encoder_vpx.h
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/host/desktop_session_proxy.cc
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/connection_unittest.cc
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/webrtc_frame_scheduler.h
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/webrtc_frame_scheduler_simple.cc
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/webrtc_frame_scheduler_simple.h
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/webrtc_video_stream.cc
[modify] https://crrev.com/14b918b5e1c3df87e6d509848bce539a8dfef264/remoting/protocol/webrtc_video_stream.h

Status: Fixed (was: Started)

Sign in to add a comment