Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

VR Oculus Quest Crash

Discussion in 'Editor & General Support' started by AliasPol, Jun 18, 2021.

  1. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    12
    Hello.

    I have problems with build of my game. It crash but only when I on the initial splash screen click oculus dash menu, then app close this menu automaticlly affter finishing splash screen. When this situation ocurs after loading scene game crash. I have one scene to Initialize some elements on start app and load new Scene Right away. If I dont use oculus menu than aplication working fine.

    This is really frustrating because and i dont really know what happen.

    Thanks for help.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    What's the specific crash text and what have you found by googling it?

    It will be something like a java exception, or perhaps a null reference.

    You can generally prune out your logs by grepping them for 'Unity' and discarding most other OS lines.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Does this behaviour still occur if you make a brand new project and only include a cube for testing?

    Also what specific version of Unity, packages, XR etc are you using?

    Please also file a bug report if you get time.
     
  4. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    12
    @Kurt-Dekker
    The crash error are in files txt, starting on 276 line
    upload_2021-6-18_21-19-46.png

    @hippocoder
    Unity 2019.4.13, and i add manifest file with all packages in project. The problem doesnt occur on empty project
     

    Attached Files:

  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    It just looks like you have a null reference, however it is possibly only because of trying to allocate too much memory, but not sure.

    If it is memory, look for massive textures (anything 4k or greater), or perhaps massive music file set to decompress fully on load.

    If it is actually just a nullref in your code, the answer is always the same... ALWAYS. It is the single most common error ever.

    Don't waste your life spinning around and round on this error. Instead, learn how to fix it fast... it's EASY!!

    Some notes on how to fix a NullReferenceException error in Unity3D
    - also known as: Unassigned Reference Exception
    - also known as: Missing Reference Exception
    - also known as: Object reference not set to an instance of an object

    http://plbm.com/?p=221

    The basic steps outlined above are:
    - Identify what is null
    - Identify why it is null
    - Fix that.

    Expect to see this error a LOT. It's easily the most common thing to do when working. Learn how to fix it rapidly. It's easy. See the above link for more tips.

    This is the kind of mindset and thinking process you need to bring to this problem:

    https://forum.unity.com/threads/why-do-my-music-ignore-the-sliders.993849/#post-6453695

    Step by step, break it down, find the problem.

    Here is a clean analogy of the actual underlying problem of a null reference exception:

    https://forum.unity.com/threads/nul...n-instance-of-an-object.1108865/#post-7137032

    If it is NOT yours but rather running out of memory or something else, you can perhaps track it down by adding Debug.Log outputs, which will show up in this log too, and perhaps let you see the last thing that ran before it blew up.

    To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

    Doing this should help you answer these types of questions:

    - is this code even running? which parts are running? how often does it run? what order does it run in?
    - what are the values of the variables involved? Are they initialized? Are the values reasonable?

    Knowing this information will help you reason about the behavior you are seeing.

    You can also put in Debug.Break() to pause the Editor when certain interesting pieces of code run, and then study the scene

    You could also just display various important quantities in UI Text elements to watch them change as you play the game.

    If you are running a mobile device you can also view the console output. Google for how on your particular mobile target.

    Here's an example of putting in a laser-focused Debug.Log() and how that can save you a TON of time wallowing around speculating what might be going wrong:

    https://forum.unity.com/threads/coroutine-missing-hint-and-error.1103197/#post-7100494
     
    hippocoder likes this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Always enable Error Pause as well, so that when you test, your null refs are caught early.
     
    Kurt-Dekker likes this.
  7. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    12
    @Kurt-Dekker
    Are you sure its normal null exception?? Becouse this error looks difrent than this:
    upload_2021-6-19_8-45-16.png

    and my problem
    upload_2021-6-19_8-47-17.png

    But more important why this error only ocur when i click dash menu on oculus when you see Splash screen section (before loaded first scene) and only then? Why somethink like that create null? And why one simple Null error crash full game? I have some null before crash and it doesnt matter game still works but this error crash full game.

    @hippocoder Error Pause you think about editor console option? This only occur on bulid.

    Thanks for all help you give me.
     
    Last edited: Jun 19, 2021
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    No I'm not... that's why I suggested perhaps out-of-memory. The reason I suggested out-of-memory was on the black-on-white error snap you posted above it contained reference into
    je_malloc_tsd_boot
    , which sounds like an allocator (purely based on the word 'malloc' inside of it).

    At this stage unless you can get more intel on it, such as attaching the debugger and seeing if you can catch what it was doing when it blew, you might have to resort to bisecting the problem by removing stuff until it stops happening.
     
  9. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    12
    @Kurt-Dekker
    Hi i finded the problem. It was null exception i the loop so its stacked and crash system. The problem was with library from oculus, the clas OVRHaptics never initialized and when i try vibrate controller the OVRHapticsChannel object was null in Haptics.

    Thanks again for all help and tips where the problem might be.

    But still doesnt understand why error exist only when you dash oculus menu in splash screen
     
  10. waltran

    waltran

    Joined:
    Feb 23, 2017
    Posts:
    36
    Hey, how did you managed to fix this? I have the same exact problem. OvrHaptics.Process causes a crash when inside the OVRHapticsOutput.Process method
    upload_2022-2-3_13-15-57.png

    Since this is Oculus' code not sure what I did wrong

    Edit: More info: Script is OVRHaptics.cs
    Class and method is OVRHapticsOutput.Process
    upload_2022-2-3_13-43-21.png

    the highlighted part returns 0 and causes a crash when I open the Oculus Dash on the beginning of splash screen.
    It returns real addresses if I don't open the Oculus Dash on the beginning of splash screen.
     
    Last edited: Feb 3, 2022