My name is Johann and I've been using the OVR SDK with DX11 for 4 months now with an Oculus Rift CV1 and everything worked fine (TrackingState OK, rendering in textures OK). Until I switched to a new computer. Both are on Windows10 (the new one is Professional, the old one is Family). The samples (downloaded on the 02/02/2018) compile just fine. However when I launch OculusRoomTiny (DX11) in Debug Win32, Visual Studio (14 2015) breaks on the function ovr_CreateTextureSwapChainDX(). The error is : Exception thrown at 0x74E65F5D in OculusRoomTiny (DX11).exe: 0xC0000005: Access violation reading location 0x00000000. However when I click on "continue", the program runs just fine on the Oculus.
Here is the call stack when the violation occurs : > ntdll.dll!_NtProtectVirtualMemory@20() Unknown KernelBase.dll!VirtualProtect() Unknown LibOVRRT32_1.dll!0f63b5a4() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for LibOVRRT32_1.dll] LibOVRRT32_1.dll!0f63a3bb() Unknown LibOVRRT32_1.dll!0f64f371() Unknown LibOVRRT32_1.dll!ovr_ReleaseHapticsClip() + 2832 bytes Unknown d3d11.dll!NDXGI::CResource::QISurface(void *,struct _GUID const &,void * *,unsigned long) Unknown d3d11.dll!NOutermost::CDevice::CreateLayeredChild() Unknown
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded. 09/02 18:22:00.504 {INFO} [Kernel:Default] [HMDState] Detected the active window handle changed to 1031d2ll The thread 0x36a8 has exited with code 0 (0x0). The thread 0x3e60 has exited with code 0 (0x0). The thread 0x1e98 has exited with code 0 (0x0). The thread 0x10c4 has exited with code 0 (0x0). The thread 0x2488 has exited with code 0 (0x0). The thread 0x1ff0 has exited with code 0 (0x0). The thread 0x21c4 has exited with code 0 (0x0). The thread 0x2b84 has exited with code 0 (0x0). 'OculusRoomTiny (DX11).exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvddui.inf_amd64_e422766d00046e2b\nvwgf2um.dll' 09/02 18:22:12.801 {INFO} [Kernel:System] Graceful shutdown: OnThreadDestroy 09/02 18:22:12.801 {INFO} [Kernel:System] Graceful shutdown: OnSystemDestroy 09/02 18:22:12.801 {DEBUG} [SharedMemory] Destroying factory 09/02 18:22:12.801 {DEBUG} [Kernel:Default] [Client] Disconnected 09/02 18:22:12.801 {INFO} [Kernel:System] Graceful shutdown: Stopping logger The thread 0x39fc has exited with code 0 (0x0). The thread 0x3d9c has exited with code 0 (0x0). The thread 0x1568 has exited with code 0 (0x0). The thread 0x24f4 has exited with code 0 (0x0). The thread 0x18b4 has exited with code 0 (0x0). The thread 0x81c has exited with code 0 (0x0). The thread 0x32c8 has exited with code 0 (0x0). The thread 0x34dc has exited with code 0 (0x0). The program '[6992] OculusRoomTiny (DX11).exe' has exited with code 0 (0x0).
I have tried to uninstall/reinstall the OculusRift application several times (I was thinking maybe there was a corrupted dll or something) but nothing has changed. I really don't know what I can do to solve this issue. Have one of you ever encountered such a problem ?
@imperativity I'm recently seeing the same access violation exception when calling the OpenGL version ovr_CreateTextureSwapChainGL. I see the same problem in our custom application as well as the Oculus Tiny Room GL demo. The exception only occurs when a Visual Studio debugger is attached. When the debugger is not attached, it seems to work fine. Visual Studio 15.5.2 or Visual Studio 14.0.25431.1 update 3. Oculus SDK 1.24 Nvidia GTX 1060 (driver 22.21.13.8205)
Exception info: Exception thrown at 0x65CD5FAD in OculusRoomTiny (GL).exe: 0xC0000005: Access violation reading location 0x00000000.
Callstack:
ntdll.dll!_NtProtectVirtualMemory@20() Unknown
KernelBase.dll!VirtualProtect() Unknown
LibOVRRT32_1.dll!0f16c854() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for LibOVRRT32_1.dll]
LibOVRRT32_1.dll!0f16b65b() Unknown
LibOVRRT32_1.dll!0f128e36() Unknown
LibOVRRT32_1.dll!0f12a92f() Unknown
[External Code]
> OculusRoomTiny (GL).exe!_free_dbg(void * block, int block_use) Line 1013 C++
LibOVRRT32_1.dll!0f13fed7() Unknown
OculusRoomTiny (GL).exe!ovr_CreateTextureSwapChainGL(ovrHmdStruct * session, const ovrTextureSwapChainDesc_ * desc, ovrTextureSwapChainData * * outTextureSet) Line 1703 C
OculusRoomTiny (GL).exe!TextureBuffer::TextureBuffer(ovrHmdStruct * session, bool rendertarget, bool displayableOnHmd, OVR::Size<int> size, int mipLevels, unsigned char * data, int sampleCount) Line 112 C++
OculusRoomTiny (GL).exe!MainLoop(bool retryCreate) Line 107 C++
OculusRoomTiny (GL).exe!OGL::Run(bool(*)(bool) MainLoop) Line 458 C++
OculusRoomTiny (GL).exe!WinMain(HINSTANCE__ * hinst, HINSTANCE__ * __formal, char * __formal, int __formal) Line 290 C++
@imperativity I have the same problem when calling the OpenGL version of the same function (ovr_CreateTextureSwapChainGL). I see it in our custom application as well as the Oculus Tiny Room GL demo. The problem only seems to occur when the Visual Studio debugger is attached. Oculus SDK 1.24. Visual Studio 2017 or Visual Studio 2015. Nvidia GTX 1060 (driver 22.21.13.8205).
Exception info: Exception thrown at 0x65CD5FAD in OculusRoomTiny (GL).exe: 0xC0000005: Access violation reading location 0x00000000.
Call Stack:
ntdll.dll!_NtProtectVirtualMemory@20() Unknown
KernelBase.dll!VirtualProtect() Unknown
LibOVRRT32_1.dll!0f16c854() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for LibOVRRT32_1.dll]
LibOVRRT32_1.dll!0f16b65b() Unknown
LibOVRRT32_1.dll!0f128e36() Unknown
LibOVRRT32_1.dll!0f12a92f() Unknown
[External Code]
> OculusRoomTiny (GL).exe!_free_dbg(void * block, int block_use) Line 1013 C++
LibOVRRT32_1.dll!0f13fed7() Unknown
OculusRoomTiny (GL).exe!ovr_CreateTextureSwapChainGL(ovrHmdStruct * session, const ovrTextureSwapChainDesc_ * desc, ovrTextureSwapChainData * * outTextureSet) Line 1703 C
OculusRoomTiny (GL).exe!TextureBuffer::TextureBuffer(ovrHmdStruct * session, bool rendertarget, bool displayableOnHmd, OVR::Size<int> size, int mipLevels, unsigned char * data, int sampleCount) Line 112 C++
OculusRoomTiny (GL).exe!MainLoop(bool retryCreate) Line 107 C++
OculusRoomTiny (GL).exe!OGL::Run(bool(*)(bool) MainLoop) Line 458 C++
OculusRoomTiny (GL).exe!WinMain(HINSTANCE__ * hinst, HINSTANCE__ * __formal, char * __formal, int __formal) Line 290 C++
This seems to be an internal exception that is thrown and also handled by the Oculus Runtime. It doesn't really affect operation, other than being very annoying. I would think that there would be a better way for their code to handle this situation rather than throwing an exception.
Hi, I think this is similar to what I see in another thread and "looking better" seems to be a problem with memory allocation, there's some allocator something that goes wrong.
What really puzzles me I spent a couple of hours yesterday looking through sources and trying to recompile things ( in 64 bits ) I can't figure out what yet but it appears there is some "mis-match" between things compiled in 32 bits and thing in 64 bits, there are some "#define" such as WIN32 and/or _WIN64 that appears to be both defined in places and I could not figure out ( yet ) what's going on or how things should be.
I haven't tried in "Release" mode yet, I suspect that without exceptions probably "it will silently pass trough" but I don't think there's any problem with VS2015, I think it's really the code or something else.
At the moment I still can not compile in 64 bits and I really don't understand what's going on yet, also same problems seems to happen even with SDK 1.24 so there's something not going well here.
Yes yes now that I see is precisely "same thing I see" is the thing that should create the swap chain and gives out somewhere a null ptr in fact hitting "continue" in the debugger all seems to go as normal but it's terribly annoying.
My opinion ? There's some little bug somewhere in the lib, proof is "it was all working before a certain update" and it's quite clear "it's that function that fails", I am still working n fixing the 64 bits "problem" and figure out what it means all those "links to missing stuff" I get, it's like some expected 64 bits functions are not there.
If you look at the code samples, in "Preprocessor" properties you will note that even when you compile in 64 bits mode there's a WIN32 defined "by default" .. WHY ? IMHO should be _WIN64 only because that "WIN32" define I suppose can cause some problems in certain .H ..
I'll continue to investigate but my opinion is there's something wrong in the SDK sources somewhere.
@imperativity I think @GilesGoat is on to something with the 32/64 bit issue. I ran a 64-bit build of the Oculus Tiny Room demo and did NOT get an exception. Switching back to 32-bit, the exception returned
EDIT: I tried this with the latest Oculus SDK (1.24) and the latest Nvidia drivers (391.01) and got the same results. Access violation exception in 32-bit, no exception in 64-bit Tiny Room demo.
Hi darknight201 .. I can compile the samples in 64 bits, you should see no exception .. however I am getting TOTALLY NUTS trying to compile my code in 64 bits getting "a lot of grief" around those "allocator things".
It seems it's all due to "RefCountBase" .. in stuff like this
RefCountBase<ShaderBase>
Despite I included/checked lib paths/etc. whatever I still cannot figure out "what goes wrong with it" when I compile in X64 profile to get all sort of weird stuff like :smile:
error LNK2019: unresolved external symbol "public: static class OVR::Allocator * __cdecl OVR::Allocator::GetInstance(bool)" (?GetInstance@Allocator@OVR@@SAPEAV12@_N@Z) referenced in function "public: virtual __cdecl OVR::RenderTiny::ShaderBase::~ShaderBase(void)" (??1ShaderBase@RenderTiny@OVR@@UEAA@XZ) 1>Render_LoadTextureDDS.obj : error LNK2001: unresolved external symbol "public: static class OVR::Allocator * __cdecl OVR::Allocator::GetInstance(bool)" (?GetInstance@Allocator@OVR@@SAPEAV12@_N@Z)