[3.5.0][BUG] Race Condition in VRCTools.cs
MisutaaAsriel
In the base VRC SDK, the line
var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
causes a race condition, resulting in an Object Not Found on some platforms, which can cause the SDK to permanently fail to upload content in Unity 2022.The following changes must be made to remedy the issue:
// File: ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs
//
// LINE 112
- var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
+ var servicePointGroup = servicePointGroups?.GetValue(scheduler);
+ if (servicePointGroup == null)
+ {
+ continue;
+ }
+ var groups = (IEnumerable)groupsList?.GetValue(servicePointGroup);
Attached is an image of the applied patch within its surrounding code.
Related bug: https://feedback.vrchat.com/sdk-bug-reports/p/350-beta1-avatar-upload-fails-on-linux-editor
Credit for Patch:
Shhasum
Log In
digitalf0x
I can confirm the fix works for me on Linux.
For automation purposes, here's a .patch file of the above change. You can apply it inside the project directory like so:
patch -p0 --forward < fix-macos-linux-VRCTools-race-condition.patch
fix-macos-linux-VRCTools-race-condition.patch:
--- Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs.orig
+++ Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs
@@ -108,7 +108,12 @@
{
continue;
}
- var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
+ var servicePointGroup = servicePointGroups?.GetValue(scheduler);
+ if (servicePointGroup == null)
+ {
+ continue;
+ }
+ var groups = (IEnumerable)groupsList?.GetValue(servicePointGroup);
// we're going to retry finding the active service point
if (groups == null)
KiyoNetcat
ran into this problem also, can confirm this fix worked for me as well!