I’ve got a strange issue in a project that uses Oculus Rift CV1 and HTC .
It just happens with the Shipping build packaged with UE4.15.0 Binary version with build number 3299760.
When I try to use EnableHMD function in a shipping build which does not start in VR mode,
a crash occurs only if the Rift CV1 is plugged in.
I successfully reproduced this issue using the VR Template that comes with UE4.15.
It just needs some minor modifications to be able to crash.
Crash reproduction steps:
- Create a project using Virtual Reality Template
- Go to Project Settings → Maps & Modes → Set GameDefaultMap to HMDLocomotionMap
- Go to Project Settings → Packaging → Set BuildConfiguration to Shipping and check IncludeDebugFiles
- Edit HMDLocomotionPawn Blueprint → Add the InputEvent ‘H’ Key and connect to EnableHMD with Enabled boolean option checked. Figure 1:
- Package the project to Windows (64-bit)
- Make sure that Rift CV1 is plugged and its service is running
- Open the packaged build and type ‘H’
- Boom! The crash occurs… (my call stack is in the end of this question)
Observations:
The weird part happens in three independent occasions:
- If you change the BuildConfiguration to Development, the EnableHmd function behaves as expected and does not crash the program.
- If you check StartInVR option in Project Settings → Project → Description, the program starts in VR and it’s possible to toggle EnableHMD function normally using the code from Figure 2:
- If you use HTC instead of Rift CV1, the program works without any problem.
Call stack from crash (step 8):
Access violation - code c0000005 (first/second chance not available)
UE4Game_Win64_Shipping!FRCPassPostProcessTonemap::Process()
UE4Game_Win64_Shipping!FRenderingCompositionGraph::RecursivelyProcess()
UE4Game_Win64_Shipping!FRenderingCompositePassContext::Process()
UE4Game_Win64_Shipping!FPostProcessing::Process()
UE4Game_Win64_Shipping!FDeferredShadingSceneRenderer::Render()
UE4Game_Win64_Shipping!FRelevancePacket::RenderThreadFinalize()
UE4Game_Win64_Shipping!TGraphTask<`FRendererModule::BeginRenderingViewFamily'::`14'::EURCMacro_FDrawSceneCommand>::ExecuteTask()
UE4Game_Win64_Shipping!FNamedTaskThread::ProcessTasksNamedThread()
UE4Game_Win64_Shipping!FNamedTaskThread::ProcessTasksUntilQuit()
UE4Game_Win64_Shipping!RenderingThreadMain()
UE4Game_Win64_Shipping!FRenderingThread::Run()
UE4Game_Win64_Shipping!FRunnableThreadWin::Run()