microsoft / MixedRealityCompanionKit

This is a MixedRealityToolkit style repository for code bits and components that may not run directly on Microsoft HoloLens or immersive headsets but instead pair with them to build experiences.
MIT License
591 stars 286 forks source link

RealtimeStreaming's Windows Desktop server crashes when I try to stop streamming (winrt::hresult_error) #338

Open danilogr opened 5 years ago

danilogr commented 5 years ago

Hello,

Whenever I try to stop streaming a video from DesktopServerApp the application crashes with a winrt::hresult_error exception.

desktop_server_crash1

Looking through the stack trace, this is the call responsible for the crash: image

It crashes on a co_await in line 86 (within method winrt::fire_and_forget Connection::RunSocketLoop() in Connection.cpp:73)

     84        // Read in the batch of data (header & payload)
     85        Buffer headerBuffer(sizeof(PayloadHeader));
---> 86        co_await inputStream.ReadAsync(headerBuffer, headerBuffer.Capacity(), InputStreamOptions::None);
     87
     88        HRESULT hr = OnHeaderReceived(headerBuffer);
danilogr commented 5 years ago

This seems to be an easy-to-handle problem as the exception is being thrown due to the socket closing.

Exception thrown at 0x00007FF88D8AA839 (KernelBase.dll) in DesktopServerApp.exe: WinRT originate error - 0x800703E3 : 'The I/O operation has been aborted because of either a thread exit or an application request.'.
Exception thrown at 0x00007FF88D8AA839 in DesktopServerApp.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000B89E3FF250
danilogr commented 5 years ago

Rookie mistake? This doesn't seem to happen when I don't debug