Search Unity

Resolved Unity player crash: OculusXRPlugin.dll caused an Access Violation

Discussion in 'VR' started by AlfredoJimenezDev, Dec 10, 2020.

  1. AlfredoJimenezDev

    AlfredoJimenezDev

    Joined:
    Jul 15, 2020
    Posts:
    7
    Hello!

    I upgraded my project from 2019.3 to 2020.1.15f1, so all the deprecated XR packages have disappeared and I have now:
    • XR Plug-in management with Oculus enabled
    • XR plugin Management 3.2.17
    • Oculus XR Plugin 1.6.1
    • XR Legacy Input Helpers 2.1.6
    • Oculus integration package (23.0)
    When I run the project in the Editor everything works fine, but when I generate a Windows build and I run the .exe I immediate get a crash (with and without a headset connected). If I untick the Oculus option in the XR Plug-in Management panel at Project Settings and I generate a new build then it works correctly.

    I also tried creating an empty project, adding all the packages and the Oculus integration package and creating a build just with one of the sample scenes and in this case worked both with the Oculus headset plugged and unplugged. So I guess that it's not a problem related to the Unity version or any incompatibility
    between the XR packages or the Oculus integration packages.

    I tried different combinations of packages and also created a build using Unity 2019.4 (LTS) and I get exactly the same error.

    The error I get in error.log is:

    ProjectXXXX by CompanyXXXX [version: Unity 2020.1.15f1_97d0ae02d19d]
    OculusXRPlugin.dll caused an Access Violation (0xc0000005)
    in module OculusXRPlugin.dll at 0033:d080217a.


    This is the stack trace:
    Stack Trace of Crashed Thread 16972:
    0x00007FFCD080217A (OculusXRPlugin) XRSDKPreInit
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFCD08010FB)
    0x00007FFCD08010FB (OculusXRPlugin) (function-name not available)
    0x00007FFD1577AC00 (ntdll) RtlRunOnceExecuteOnce
    0x00007FFD1309E88B (KERNELBASE) InitOnceExecuteOnce
    0x00007FFCD0814AEB (OculusXRPlugin) GetCurrentFrameIndex
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFCD08011A0)
    0x00007FFCD08011A0 (OculusXRPlugin) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFCD08012A4)
    0x00007FFCD08012A4 (OculusXRPlugin) (function-name not available)
    0x00007FFC81797C87 (UnityPlayer) XRPreInit::GetGraphicsAdapterId
    0x00007FFC80A59CF6 (UnityPlayer) SelectAdapterByLuidIfAvailableOrByIndex
    0x00007FFC80A57489 (UnityPlayer) InitializeD3D11
    0x00007FFC80A52A83 (UnityPlayer) CreateD3D11GfxDevice
    0x00007FFC81441E65 (UnityPlayer) CreateRealGfxDevice
    0x00007FFC80B047AF (UnityPlayer) CreateClientGfxDevice
    0x00007FFC8144191A (UnityPlayer) CreateGfxDevice
    0x00007FFC814437F1 (UnityPlayer) InitializeGfxDevice
    0x00007FFC810A4BB6 (UnityPlayer) InitializeEngineGraphics
    0x00007FFC810C5E20 (UnityPlayer) PlayerInitEngineGraphics
    0x00007FFC80B61ED6 (UnityPlayer) UnityMainImpl
    0x00007FFC80B6393B (UnityPlayer) UnityMain
    0x00007FF670CE11F2 (OMS) __scrt_common_main_seh
    0x00007FFD13A87034 (KERNEL32) BaseThreadInitThunk
    0x00007FFD157BD0D1 (ntdll) RtlUserThreadStart


    I'm attaching the error.log and Player.log found in the crash folder.

    PD: I also tried to debug the crash.dmp but Visual Studio can't find OculusXRPlugin.pdb (I created the build with Copy PDB Files and ir generates a lot of pdb files, but not OculusXRPlugin.pdb) so I don't really what is causing the problem (attached screenshot)

    I hope you can help with this situation because I don't know what else I can try.

    Thanks in advance.
     

    Attached Files:

  2. AlfredoJimenezDev

    AlfredoJimenezDev

    Joined:
    Jul 15, 2020
    Posts:
    7
    I also tried with Unity 2020.1.17f1 using a different computer and the result is the same.
     
  3. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Hi, can you please file a bug with reproducible project so the team can properly track and investigate? Thanks!
     
  4. AlfredoJimenezDev

    AlfredoJimenezDev

    Joined:
    Jul 15, 2020
    Posts:
    7
    Hello mfuad, I think I found the problem. I deleted a folder with an old OVR plugin, I created a new build and it works now using the headset and also in standalone. I have to test it more in depth but seems to work great.
     

    Attached Files:

  5. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Great to hear @AlfredoJimenezDev. File a bug if you run across any more issues and the team will take a look. Cheers!