microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6.01k stars 2.12k forks source link

Crash after the logo using MRKT2.8 + Unity 2021LTS #11001

Closed edgar-rodrigo-santos closed 10 months ago

edgar-rodrigo-santos commented 2 years ago

Hello,

I am writing this in hope that somebody as an idea on what might be going on in our project.

We had a working 2019LTS project that was updated to 2021LTS with the latest mrtk2 version. At the moment, we are able to run the app inside unity with the simulation input but in Hololens 2 it crashes right after showing the logo. Let's call this app, our "main" app.

For troubleshooting purposes, we also have a very simple app with exactly the same configurations that just writes some text in the screen. Let's call this app, our "simple" app.

The "simple" app runs just fine in Hololens 2. The "main" app doesn't. We reached the point where we made sure that the "main" app startup scene is not running any code, and it still crashes.

The Error output we get is the following: [MROpenXR][Info ][17:33:05.257221][tid:798] XrViewConfigurationSettings_OnXrSessionCreated SupportedViewConfigType=XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO SupportedReprojectionModesCount=0 [MROpenXR][Info ][17:33:05.257994][tid:798] XrViewConfigurationSettings_OnXrSessionCreated SupportedViewConfigType=XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT SupportedReprojectionModesCount=0 [MROpenXR][Info ][17:33:05.258357][tid:798] OnSessionCreated GraphicsAPI=XR_TYPE_GRAPHICS_BINDING_D3D11_KHR sessionCreationResult=XR_SUCCESS AppName= AppVersion= AppMode= openXRRuntimeName= openXRRuntimeVersion= APIVersion= PartA_PrivTags=33554432 [MROpenXR][Info ][17:33:05.323155][tid:798] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=2 sessionState=XR_SESSION_STATE_IDLE [MROpenXR][Info ][17:33:05.324678][tid:798] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=2 sessionState=XR_SESSION_STATE_READY [MROpenXR][Info ][17:33:05.325254][tid:798] ViewConfigurationSettings_PrimaryStereoEnabled [MROpenXR][Info ][17:33:05.325547][tid:798] ViewConfigurationSettings_OnSessionBegan_SecondaryBeginInfo EnabledSecondaryViewConfigurationCount=1 [MROpenXR][Info ][17:33:05.325935][tid:798] ViewConfigurationSettings_OnSessionBegan_EnabledSecondaryViewConfiguration EnabledSecondaryViewConfiguration=XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT [MROpenXR][Info ][17:33:05.326374][tid:798] LocatableCameraProvider_Registered [MROpenXR][Info ][17:33:05.350446][tid:798] SetSceneOriginSpace nativeToken=2 oldSpace=0 newSpace=3 [MROpenXR][Info ][17:33:05.350937][tid:798] SetSceneOriginSpace nativeToken=1 oldSpace=0 newSpace=3 [MROpenXR][Info ][17:33:05.351238][tid:798] SetSceneOriginSpace nativeToken=4 oldSpace=0 newSpace=3 [MROpenXR][Verbose][17:33:05.351693][tid:798] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=HandTracking [MROpenXR][Info ][17:33:05.352033][tid:798] InputProvider_LifecycleStart [MROpenXR][Verbose][17:33:05.352981][tid:798] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=HoloLens [MROpenXR][Verbose][17:33:05.353643][tid:798] MicrosoftOpenXRPlugin_OnSubsystemsStarting NativeLibToken=Controller [MROpenXR][Info ][17:33:06.671657][tid:798] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=2 sessionState=XR_SESSION_STATE_SYNCHRONIZED [MROpenXR][Info ][17:33:06.672446][tid:798] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=2 sessionState=XR_SESSION_STATE_VISIBLE [MROpenXR][Info ][17:33:06.672846][tid:798] OpenXRContext_OnEvent_XrEventDataSessionStateChanged EventType=XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED session=2 sessionState=XR_SESSION_STATE_FOCUSED onecore\base\windows.storage\src\win32proxy.cpp(339)\windows.storage.onecore.dll!00007FF8D790B080: (caller: 00007FF900445BD8) LogHr(2) tid(798) 80070005 Access is denied. CallContext:[\FindFirstFileExProxyActivity] Exception thrown at 0x00007FF8BC578D14 (GameAssembly.dll) in ASSIST.exe: 0xC0000005: Access violation reading location 0x00000000000000F4. This seems to be somewhat related with "[MROpenXR]" but we're not sure what else we could check/troubleshoot to understand the source of this issue.

keveleigh commented 2 years ago

Hmm, nothing looks out of the ordinary in those logs as far as MROpenXR is concerned. Is FindFirstFileExProxyActivity something in your app? A quick search of MRTK, OpenXR, etc didn't surface anything for me.

edgar-rodrigo-santos commented 2 years ago

@keveleigh We have no idea what "FindFirstFileExProxyActivity" might be, It's not ours, but it might be from some external dependency. We are trying to dig deeper into this.

edgar-rodrigo-santos commented 2 years ago

We narrowed it down to external packages causing the issue (like we were suspecting). We still don't know which package exactly was causing this but the app booted after removing the following at the same time:

Since this issue is not happening anymore I think we can close it. Hopefully it'll be helpful to someone in the future. Thank you

edgar-rodrigo-santos commented 2 years ago

We eventually found out it was the "com.unity.entities" package that caused this.

keveleigh commented 2 years ago

Oh wow, I'm able to repro this as well. Have you filed a Unity bug and (if so) could post the bug number here? Thanks!

edgar-rodrigo-santos commented 2 years ago

Hello.

I'm sorry, since we don't really needed the "com.unity.entities", we decided not to spend further time reporting the bug and creating a separate project where this could be reproduced, etc, etc.

We probably should as soon as we have the time, just in case.

IssueSyncBot commented 10 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!