microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
898 stars 277 forks source link

Mixed Reality WebRTC Unity Data Channel crashes when data is sent both ways #827

Open dsf5644s6sdf opened 2 years ago

dsf5644s6sdf commented 2 years ago

Hello,

I’m connecting 2 applications (network node A and B) with Mixed Reality WebRTC for Unity version 2.0.2. Applications A and B are running in the Unity Editor, version 2019.4.16f1. Both applications run on a local network.

Problem: Unity Editor of application B crashes randomly about 30sec after I connect the two applications with Mixed Reality WebRTC. The crash only happens when I connect the two nodes with a data channel and when I send data channel messages in both directions. Whenever I only send data one way, no crash occurs. I already check DataChannel.BufferingChanged, no congestion is happening. I send the following data through the data channel: 4 Bytes long data channel messages from A to B 10 times per second. 4 Bytes long data channel messages from B to A 10 times per second. 50 KB long data channel messages from A to B 15 times per second.

Only application B crashes after about 30 seconds. Application A always stays alive. It doesn’t matter if A or B initiates the connection. After B crashed, A’s DataChannel.BufferingChanged fires, as expected.

When I lower the amount of data I send over the data channel, the crash of application B occurs later (after a few minutes).

Unfortunately, I don’t get any exception in Unity or any crash report from Unity. The only information I get about the crash is on the OS level:

Microsoft event viewer:

Faulting application name: Unity.exe, version: 2019.4.16.23406, time stamp: 0x5fbde861 Faulting module name: mrwebrtc.dll, version: 0.0.0.0, time stamp: 0x5f746196 Exception code: 0xc0000409 Fault offset: 0x00000000005ba01d Faulting process id: 0xbe4 Faulting application start time: 0x01d7bae957d7c7c0 Faulting application path: C:\Program Files\Unity\Hub\Editor\2019.4.16f1\Editor\Unity.exe Faulting module path: B\Assets\MixedReality-WebRTC\Runtime\Plugins\Win32\x86_64\mrwebrtc.dll Report Id: f0cbce95-780b-4b9b-ba2e-4514e9484ec5 Faulting package full name: Faulting package-relative application ID:

Any idea why this happens? How can I create a more detailed crash report?

vodolazov commented 2 years ago

I have a similar issue and I figured out that if crashes (hangs) when both sides try to send into the channel right after initialization. It looks like it works as expected if one party sends and the other receives first, i.e. comminucatoin is initiated by one of the parties. After that I can send and receive both ways no problem.

vodolazov commented 2 years ago

It is still very unstable though