ValveSoftware / steamvr_unity_plugin

SteamVR Unity Plugin - Documentation at: https://valvesoftware.github.io/steamvr_unity_plugin/
BSD 3-Clause "New" or "Revised" License
1.04k stars 259 forks source link

Unity crashing when exiting play mode, VR #1100

Open EirikAmbjornsen opened 2 years ago

EirikAmbjornsen commented 2 years ago

We are using mane different packages, including SteamVR. When we exit play mode, Unity crashes. The error tells us it's because of Valve issues. We are using a Vive Focus 3.

Error message in EDITOR:

(Filename: Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs Line: 302)

[XR] [OpenVR] Device connecting (status change). OpenVRIndex: 2. UnityID: 1 [XR] [OpenVR] Device connected (status change). Handle: 1795157616. OpenVRIndex: 2. UnityID: 1 [XR] [OpenVR] Found device OpenVRIndex:(2) UnityIndex:(1) with input profile:(vive_cosmos_controller) and name: (OpenVR Controller(vive_cosmos_controller)) [XR] [OpenVR] Device connecting (status change). OpenVRIndex: 1. UnityID: 2 [XR] [OpenVR] Device connected (status change). Handle: 1795157616. OpenVRIndex: 1. UnityID: 2 [XR] [OpenVR] Found device OpenVRIndex:(1) UnityIndex:(2) with input profile:(vive_cosmos_controller) and name: (OpenVR Controller(vive_cosmos_controller)) [XR] [OpenVR] Device disconnecting (characteristics change). OpenVRIndex: 1. UnityID: 2 [XR] [OpenVR] Device disconnecting (characteristics change). OpenVRIndex: 2. UnityID: 1 [XR] [OpenVR] Device disconnected (status change). Handle: 1795157616. OpenVRIndex: 2. UnityID: 1 [XR] [OpenVR] Device disconnected (status change). Handle: 1795157616. OpenVRIndex: 1. UnityID: 2 [XR] [OpenVR] Device connecting (status change). OpenVRIndex: 1. UnityID: 1 [XR] [OpenVR] Device connecting (status change). OpenVRIndex: 2. UnityID: 2 [XR] [OpenVR] Device connected (status change). Handle: 1795157616. OpenVRIndex: 1. UnityID: 1 [XR] [OpenVR] Device connected (status change). Handle: 1795157616. OpenVRIndex: 2. UnityID: 2 [XR] [OpenVR] Found device OpenVRIndex:(1) UnityIndex:(1) with input profile:(vive_cosmos_controller) and name: (OpenVR Controller(vive_cosmos_controller) - Right) [XR] [OpenVR] Found device OpenVRIndex:(2) UnityIndex:(2) with input profile:(vive_cosmos_controller) and name: (OpenVR Controller(vive_cosmos_controller) - Left) Asset Pipeline Refresh: Total: 0.019 seconds - Initiated by RefreshV2(AllowForceSynchronousImport) [XR] [OpenVR] Device disconnected (stopping provider). Handle: 1795157616. DeviceID: 0 [XR] [OpenVR] Device disconnected (stopping provider). Handle: 1795157616. DeviceID: 1 [XR] [OpenVR] Device disconnected (stopping provider). Handle: 1795157616. DeviceID: 2 [XR] [OpenVR] XR OpenVR Display Stop [XR] [OpenVR] XR OpenVR Display Shutdown XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture [XR] [OpenVR] Shutdown XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture XRTextureManager::RequestDestroyTexture

================================================================= Native Crash Reporting

Got a UNKNOWN while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

================================================================= Managed Stacktrace:

  at <unknown> <0xffffffff>
  at System.Object:wrapper_native_00007FFB56256190 <0x00142>
  at Valve.VR.CVRSystem:GetFloatTrackedDeviceProperty <0x000c2>
  at Valve.VR.SteamVR:GetFloatProperty <0x000fa>
  at Valve.VR.SteamVR:get_hmd_DisplayFrequency <0x0009a>
  at Valve.VR.SteamVR_Action_Pose_Source:UpdateValue <0x00632>
  at Valve.VR.SteamVR_Action_Skeleton_Source:UpdateValue <0x00922>
  at Valve.VR.SteamVR_Action_Skeleton:UpdateValueWithoutEvents <0x000be>
  at <DoRangeOfMotionBlend>d__156:MoveNext <0x00322>
  at UnityEngine.SetupCoroutine:InvokeMoveNext <0x001b0>
  at <Module>:runtime_invoke_void_object_intptr <0x0019f>

================================================================= Received signal SIGSEGV Obtained 2 stack frames RtlLookupFunctionEntry returned NULL function. Aborting stack walk.

jonathanhook commented 1 year ago

Did you find a cause or solution for this? We’re experiencing the same issue one some machines but not others (we have a teaching lab with 7 near-identical setups).

It appeared that it could be fixed by using the old school [CameraRig] prefab instead of the Player prefab from the interaction system. However, the error seems to appear just less frequently.

eirikamb commented 1 year ago

@jonathanhook No, we didnt find any fix..

zite commented 1 year ago

I realize this is quite old but what versions of unity are you folks using that are getting these crashes? Is it still happening?

BANZBOWINKEL commented 1 year ago

I am using 2022.3.7 and it still seems to happen...

zite commented 1 year ago

Hey @BANZBOWINKEL can you give the latest beta a try and see if that fixes the problem? https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/2.8.0b1

Kiramei commented 8 months ago

I'm also undergoing this bug of crash. I wonder if there is any solution.

For more information, I could tell that the bug is always being invoked in every case that I use a Teleport Component. In another word, if I don't use the specific component, I'd exit the play mode normally.

With lots of trials, I've deepened the understanding of the problem and targeted the probable cause of the crash. The component of Teleporting that may cause the problem.

I've also tested the project on computers of my friend's. To my astonishment, this kind of crash never occurs on his Unity Editor. What confuses us is that the environments are mostly the same, but the bug only catches me.

Hope there's some superiors to solve the problem.

The crash log can be viewed as:

=================================================================
    Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at System.Object:wrapper_native_00007FF99EF6FF80 <0x0012c>
      at Valve.VR.CVRChaperone:GetPlayAreaSize <0x000f4>
      at <Start>d__21:MoveNext <0x002a2>
      at UnityEngine.SetupCoroutine:InvokeMoveNext <0x001b0>
      at <Module>:runtime_invoke_void_object_intptr <0x0019f>
=================================================================
Received signal SIGSEGV
Obtained 2 stack frames
RtlLookupFunctionEntry returned NULL function. Aborting stack walk.
<Missing stacktrace information>
jonathanhook commented 8 months ago

If this is the same bug as we had, we did find a fix in a class we were teaching a few weeks back. The fix was simply to open up the controller binding UI in the headset view (presumably works in the editor too) and then select the default binding.

The issue seemed to crop up in that class when our students had run their scenes before choosing "Save and Generate" from the Steam VR Input Window. However, resetting the binding to default (as described above) did seem to fix the issue and prevent it coming back.

The bug being related to the config of the Vive itself, and not the Unity project, would make sense based on what we observed: same code crashing for some students but not for others suggesting a connection to the Steam account.