Array Index Out of Bounds - OpenXR crashes when playing VR Preview a second time in both UE 5.1.1 and 5.0.3

Hi, when using UE5 with Meta Quest 2, launching VR preview will crash the engine the second time I try to launch (first time works fine, as expected).

Steps to reproduce:

  1. Connect Meta Quest 2 to the PC, open Oculus Link in the headset, launching the Oculus App on the PC
  2. Open Unreal Engine
  3. Launch the game in VR Preview-mode
  4. Close the VR Preview-mode
  5. Launch the game in VR Preview-mode again

image
It will remain white, then crash.

Searching through the logs, this seems to be the reason:

[2023.11.08-12.00.19:855][356]LogOutputDevice: Error: Ensure condition failed: ((Result) >= 0) [File:D:\build++UE5\Sync\Engine\Plugins\Runtime\OpenXR\Source\OpenXRHMD\Private\OpenXRHMD.cpp] [Line: 1045]
[2023.11.08-12.00.19:855][356]LogOutputDevice: Error: OpenXR call failed with result XR_ERROR_SYSTEM_INVALID

My Meta Quest 2 is connected and is running the Oculus App, using Oculus Link to enable the VR Preview in Unreal prior to launching both of the times.

I believe this is an issue with OpenXR, it happens on two different VR-projects, both in UE 5.0.3 and 5.1.1.

I also think that this issue is connected to both of these earlier posts:
First Post
Second Post

2 Likes

Same symptoms here, Array Index out of Bounds too…

LoginId:6add565b4e83249bb4d6ed85210d9753
EpicAccountId:3f6bb25e6ba0499a8d00cf8871ed187a

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 763] Array index out of bounds: 0 from an array of size 0

UnrealEditor_OpenXRHMD
UnrealEditor_HeadMountedDisplay
UnrealEditor_Renderer
UnrealEditor_Renderer
UnrealEditor_Renderer
UnrealEditor_Renderer
UnrealEditor_Renderer
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_RenderCore
UnrealEditor_RenderCore
UnrealEditor_Core
UnrealEditor_Core
kernel32
ntdll

Seems to be a bug related to some Oculus update. Setting SteamVR as the default OpenXR runtime and launching it before the editor is a workaround.

This issue was introduced by the last Oculus app update, I don’t think Unreal team can do anything about that. You can create a ticket here: https://communityforums.atmeta.com/t5/Unreal-VR-Development/bd-p/dev-unreal

There are already 2 tickets about it, but the more, the faster they’ll consider this issue important.

Correct

UE427plus crash when going twice in VR, function xrCreateSession Fail in OpenXRHMD.cpp (so calling OpenXR core dll surely).

Oculus app is 59.00.138.366

Tested same code with VIVE headset, OpenXR and SteamVR (2.0.10) and no crash.

Oculus OpenXR runtime seem to be the problem.

Yep got the same issue since last update, glad to see it’s not just on my end

Same issue here. Super bad timing, last week before major milestone. Shape up meta…

I found a solution by installing MetaXR Plugin https://developer.oculus.com/downloads/package/unreal-engine-5-integration/51.0

Work with v51.0 for UE 5.1.1, when you choose other one it will write in requirements what UE version need to have.

Related here [5.1 Hand Samples - Array Index error? · Issue #247 · Oculus-VR/UnrealEngine (github.com)] (https://github.com/Oculus-VR/UnrealEngine/issues/247)

Thanks for the suggestion, added a copy-paste of this post in that linked forum.

This worked, thank you for this suggestion!
It is a temporary fix while we can hope that Meta/Oculus fixes the issue, hopefully soon.

1 Like

Thanks everyone for providing us with all of these details. Just wanted to let you know that I’ve reported the issue to Meta.

3 Likes

Hello guys, has the issue been solved with meta yet?
Thanks for any update you can give me im having this same problem on UE 4.27

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.