Forum Discussion

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

Followed MinimalOculus and get error

Hi all. For background I'm using Windows 7 64-bit and Visual Studio C++ 2010 Express. I do not have the oculus connected because it does not get here until tomorrow :cry:

When I build and run the application I get:
"Unhandled exception at 0x76ee15de in MinimalOculus.exe: 0xC0000005: Access violation writing location 0x00000014."

I don't do much C++ on Windows, so I have no idea what this is! :(

Any help would be greatly appreciated!

9 Replies

  • It's not really a windows thing, more a general programming thing.
    Access violation writing location 0x00000014.
    that means that something was passed a null pointer and tried to write to it (well tried to write to an offset 20 bytes into it). Typically the null pointer and several kilobytes / megabytes beyond it are locked down by the OS so that any attempts to read or write to them will generate an exception. This is specifically because NULL pointers bugs are the most common kind of bugs and making them explode in that fashion is the easiest way to get them noticed.

    Also, since MinimalOculus isn't part of the SDK, you might want to include a link to more information about the application. The SDK samples are pretty conscientious about ensuring that they only try to access an HMD if it's detected, other programs out in the wild may be more rough and assume you have the HMD connected, so unless you're debugging it and can see what the call stack looked like, just trying to figure it out from those hex numbers isn't going to be possible.
  • Forgot to mention that, it's from the wiki: https://developer.oculus.com/wiki/Minimal_Oculus_Application

    I've been trying to find a null reference being written to for a while now and I can't. It happens during the call to System::Destroy and I have no idea what that does. Going to try some of the samples and see if the same thing happens there. I've never encountered this under g++/linux so I thought it might be windows/vs specific.
  • If it's crashing in System::Destroy and you're not seeing normal behavior before that (i.e., it's not just crashing when you exit, but on startup) then what you're seeing is actually likely a secondary effect. In other words, something in your application throws an exception, and during cleanup System::Destroy() gets called and it too throws an exception, meaning you don't see the actual exception.

    Have you tried stepping through the code? In particular, you could try putting a breakpoint at System::Init() in your own Init() method and step over the functions one by one until you see an error or exception thrown. The compiler will actually probably automatically hit a breakpoint if a null pointer is accessed. I'm not sure, I mostly use Eclipse these days, but I seem to remember VS would do that as well.
  • The application performs normally up until that point. I will try stepping through line by line and see if it performs differently.
  • Didn't seem to reveal anything stepping thorough it. Here's the call stack

    ntdll.dll!77d215de()
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
    ntdll.dll!77d215de()
    ntdll.dll!77d1014e()
    > msvcr100.dll!exit(int code) Line 393 + 0xc bytes C
    MinimalOculus.exe!__tmainCRTStartup() Line 572 C
    kernel32.dll!773e33aa()
    ntdll.dll!77d39ef2()
    ntdll.dll!77d39ec5()


    The line with the > is
    doexit(code, 0, 0); /* full term, kill process */

    Made sure it wasn't me making a typo by going through it again and copying all of the code. Still happens.
  • Hello,

    I get the exact same error when trying the minimal sdk tutorial from the wiki. I've tried multiple versions of visual express, copied the code exactly and always get the same error.
  • It's easy to see this happening if the Init() method as given doesn't succeed in the HMD device creation. You might want to use a debugger and step through, or put some debugging output.
  • Anonymous's avatar
    Anonymous
    Hey just got the same error... grrr then I plugged in the USB.

    Doh.
  • Hi !

    I'm getting also that kind of error when I run the demo provided in the wiki. Here is what I get :

    Unhandled exception at 0x77EA3EA0 (ntdll.dll) in Oculus-vs.exe: 0xC0000005: Access violation writing location 0x00000014.


    I do not have the oculus yet. I'm also using VS 2012. Does anyone have an idea on how to fix that ?

    Thanks !