Crash when WHIP streaming with NordVPN "Split Tunnelling" enabled
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
30.1.0-beta3
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/oobmVEbfRTmMrBKE
OBS Studio Crash Log URL
https://obsproject.com/logs/sT5F2mCrxAa5zWT4
Expected Behavior
OBS to stream to the WHIP endpoint without crashing OBS
Current Behavior
With Split Tunnelling in NordVPN enabled - but with OBS not being selected to send traffic down the VPN - OBS will crash as soon as I press "Start Streaming" with a crash log being generated
Steps to Reproduce
- Enable "Split Tunnelling" in NordVPN without OBS being sent down the VPN
- Set a WHIP endpoint in OBS
- Press Start Streaming
- Crash occurs
Anything else we should know?
The crash also does not happen when streaming via RTMP with Split Tunnelling enabled, so it seems specific to WHIP in my testing.
The crash does not happen when Split Tunnelling is NOT enabled in NordVPN, so it does seem like a very specific edge case.
Tagging @Sean-Der to check this one. Seems the crash is in libdatachannel, not OBS.
@Fenrirthviti I am fairly certain it is https://github.com/obsproject/obs-studio/pull/10305
Anyone available to review?
From a skim of the git history/blame, this bug would also be present in OBS Studio 30.0.2. Is that true?
Can confirm that the WHIP crash also happens in 30.0.2 when Split Tunnelling is enabled.
In testing on 30.0.2, the additional points are still true:
- It does not happen when Split Tunnelling isn't enabled, but still connected to the VPN
- With Split Tunnelling enabled, I can stream to YouTube via RTMP.
In testing where Split Tunnelling is enabled, OBS is NOT routed down the VPN.
@Fenrirthviti I am fairly certain it is #10305
Anyone available to review?
Worth noting that even if we merge that PR, streaming WHIP as configured by OP here will still not work. The only difference will be that OBS will emit an error instead of crashing.
I am happy to help fix that! I would really like to fix things crashing though, makes it a lot easier for me to debug.
My guess is that libdatachannel isn't gathering (listening) on the VPN interface.
My guess is that libdatachannel isn't gathering (listening) on the VPN interface.
Only caveat to that is that it appears to work fine with the VPN connected and split tunnelling disabled.
Let me know if you want any further testing to help out. Happy to check Wireshark to confirm what traffic is actually go where on the interfaces.
The crash as reported here has been fixed by #10305. As the configuration not working is a separate matter, I am inclined to close this Issue. We can address the issue with split tunneling not working as a separate matter, if needed. @Fenrirthviti ?
The crash as reported here has been fixed by #10305. As the configuration not working is a separate matter, I am inclined to close this Issue. We can address the issue with split tunneling not working as a separate matter, if needed. @Fenrirthviti ?
I just downloaded the artifacts from #10305 and the crash still occurs
https://obsproject.com/logs/OZErOj2W4JwZx5p6
Looks like this crash is happening in Setup() rather than in Connect(), which #10305 addressed.
Does this crash happen with any WHIP ingest, preferably one that is publicly available and easy to test against?
Looks like this crash is happening in
Setup()rather than inConnect(), which #10305 addressed.Does this crash happen with any WHIP ingest, preferably one that is publicly available and easy to test against?
Yes, I tested with https://b.siobud.com/api/whip at https://b.siobud.com/
The crash happens internally in libdatachannel.
The reason it crashes is because bind fails when NordVPN is enabled. If I disable the VPN the bind succeeds. I can reproduce this with just a simple C program on Windows.
I will keep investigating. I am not sure yet if I can make things work with NordVPN, but we should at least have better error handling!
I was able to get a minimal reproduce with this https://github.com/Sean-Der/libdatachannel/tree/p2p-example I get Error: Failed to bind UDP socket
Using WinSock directly I am able to get UDP connectivity. Going to debug in libjuice now what the issue is.
libjuice's unit tests segfault with NordVPN on (and pass with it off)
I will fix and send a PR upstream. This is the root cause!
I have a PR upstream that fixes the issue https://github.com/paullouisageneau/libjuice/pull/245