Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
6 years ago

[bug] Initialization & deinitialization of SDK two or more times leads to crash on app shutdown

Repro steps:
  • go to OculusRoomTiny (GL) sample and locate main.cpp
  • modify WinMain (just add the loop):
int WINAPI WinMain(HINSTANCE hinst, HINSTANCE, LPSTR, int)
{
    int c = 0;
     do
     {
          // Initializes LibOVR, and the Rift
          ovrInitParams initParams = { ovrInit_RequestVersion | ovrInit_FocusAware, OVR_MINOR_VERSION, NULL, 0, 0 };
          ovrResult result = ovr_Initialize(&initParams);
          VALIDATE(OVR_SUCCESS(result), "Failed to initialize libOVR.");
    
          VALIDATE(Platform.InitWindow(hinst, L"Oculus Room Tiny (GL)"), "Failed to open window.");

          Platform.Run(MainLoop);
        ovr_Shutdown();
     } while (++c != 2);

    return(0);
}
  • compile & run it, close it 2 times
  • crash!!! in static deinitialization section of the app
    Exception thrown at 0x7B3A1216 (nvapi.dll) in OculusRoomTiny (GL).exe: 0xC0000005: Access violation reading location 0x5FB55D2C.

    Looks like crash in nvidia drivers.

2 Replies

  • Anonymous's avatar
    Anonymous
    int WINAPI WinMain(HINSTANCE hinst, HINSTANCE, LPSTR, int)
    {
    int c = 0;
    do
    {
    /* original code here, except return(0)*/
    } while (++c != 2);
    return(0);
    }
    the code snippet was cut off so I uploaded shorter version
  • Anonymous's avatar
    Anonymous
    Just had found out it always crashes even when the sample is uses as provided, no loop needed to reproduce the crash