cancel
Showing results for 
Search instead for 
Did you mean: 

Exception thrown when calling ovr_CreateTextureSwapChainDX

Anonymous
Not applicable
Hello,

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

Here is the full output of the program :
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Users\jnovak\Downloads\OculusSDK\Samples\OculusRoomTiny\OculusRoomTiny (DX11)\Bin\Windows\Win32\Debug\VS2015\OculusRoomTiny (DX11).exe'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\dxgi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d11.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\D3DCompiler_47.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptsp.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\rsaenh.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\imagehlp.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\gpapi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Program Files\Oculus\Support\oculus-runtime\LibOVRRT32_1.dll'. Cannot find or open the PDB file.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Unloaded 'C:\Windows\SysWOW64\winmmbase.dll'
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\dbghelp.dll'. Symbols loaded.
09/02 18:21:47.226 {INFO}    [Kernel:Default] [CAPI] LibOVR module is located at C:\Program Files\Oculus\Support\oculus-runtime\LibOVRRT32_1.dll
09/02 18:21:47.232 {DEBUG}   [Client] Connected to the server running version (prod = 1).1.23.0(build = 528114) feature version = 0. Client runs version (prod = 1).1.23.0(build = 0) feature version = 0
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded.
09/02 18:21:47.245 {DEBUG}   [Kernel:Default] [HMDState] Using default profile default
09/02 18:21:47.246 {INFO}    [Kernel:Default] IAD changed to 58.3mm
09/02 18:21:47.246 {DEBUG}   [SharedMemory] Creating factory
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WinTypes.dll'
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\ResourcePolicyClient.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ResourcePolicyClient.dll'
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvddui.inf_amd64_e422766d00046e2b\nvwgf2um.dll'. Cannot find or open the PDB file.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvspcap.dll'. Cannot find or open the PDB file.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Symbols loaded.
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\winhttp.dll'. Symbols loaded.
The thread 0x174c has exited with code 0 (0x0).
'OculusRoomTiny (DX11).exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvapi.dll'. Cannot find or open the PDB file.
Exception thrown at 0x74E65F5D in OculusRoomTiny (DX11).exe: 0xC0000005: Access violation reading location 0x00000000.

'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 ?

Thank you,

Kind regards,
Johann NOVAK
11 REPLIES 11

Anonymous
Not applicable
Hi,

My GPU is an NVidia GeForce GTX 970 (driver v.21.21.13.6930).
The complete logs are in attachment.

Thank you again for your time.

Johann

darknight201
Explorer
@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++
  [External Code]

darknight201
Explorer
@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++
  [External Code]

Anonymous
Not applicable
Hi,

That's reassuring that I'm not the only one with this issue.
I'm using Visual Studio Community 2015 Version 14.0.25431.01 Update 3.

darknight201
Explorer
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.

Anonymous
Not applicable
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.

darknight201
Explorer
If it makes any difference, I'm seeing the exception in a 32 bit build also. I'll try 64 bit later today

darknight201
Explorer
@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.

Anonymous
Not applicable
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)

it's making me nuts.