Skip to main content
Up and Coming
October 2, 2015

OculusRoomTiny (DX11) SDK 0.7 often crashes in Release

The Oculus demo code has been kind of ugly C++ for a while but it's got worse with SDK 0.7. There's some particularly nasty C-style use of goto's for error handling in the MainLoop() function which comes along with some buggy code.

This code at line 175 of main.cpp is disabling a very legitimate warning:


// Create camera
__pragma(warning(push))
__pragma(warning(disable:4316)) // Win32: object allocated on the heap may not be aligned 16
mainCam = new Camera(&XMVectorSet(0.0f, 1.6f, 5.0f, 0), &XMQuaternionIdentity());
__pragma(warning(pop))


This frequently crashes in a Release build on my machine with an access violation resulting from an aligned SSE move instruction on memory that is not necessarily aligned to 16 bytes - exactly what the disabled warning is complaining about.

This is particularly unfortunate code since there is no good reason for the Camera to be dynamically allocated in the first place.

The demo code is pretty poor quality overall with numerous D3D resource leaks, and questionable C++ style. Are there plans to improve it before the 1.0 release?

    1 reply

    Inspiring
    October 2, 2015
    Let me see if anyone here knows about this.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV