MixedRealityCompanionKit icon indicating copy to clipboard operation
MixedRealityCompanionKit copied to clipboard

RealtimeStreaming Client crashes at the end of a connection (Invalid read size)

Open danilogr opened this issue 5 years ago • 1 comments

This happened while I was testing on Unity 2018.4.2f1 on Windows 1903 with the RealtimeStreaming compiled as Debug. Server (HoloLens) crashed and caused the client (Unity) to crash.

I attached VisualStudio to Unity and this is what the library prints on the console:

DataBundleArgsImpl::~DataBundleArgsImpl()
RealtimeMediaSource::OnDataReceived(0)
Connection::RunSocketLoop - Tid: 20584 
Connection::OnHeaderReceived() - Tid: 20584 
Connection::OnHeaderReceived() - Invalid read size 
Exception thrown at 0x00007FF88D8AA839 (KernelBase.dll) in Unity.exe: WinRT originate error - 0x800704B1 : 'The device is not currently connected but it is a remembered connection.'.
Exception thrown at 0x00007FF88D8AA839 in Unity.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000000005FC818.

This is the stack trace: image

To me, it seems that RealtimeStreaming throws an exception it could catch later. Often, TCP reads fail when the other party disconnected.

danilogr avatar Jun 25 '19 15:06 danilogr

Perhaps add a try-catch here? image

danilogr avatar Jun 25 '19 15:06 danilogr