Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

FloatConversion.h Assertion Failed

Discussion in 'VR' started by JJJohan, Sep 14, 2016.

  1. JJJohan


    Mar 18, 2016
    I'm experiencing the following assertion being thrown, only happening on the HoloLens for a rather large and complex project. It is not surprising to see an issue with floating point numbers here as we handle a lot of conversions between doubles and floats as we need to extra precision (non-game related project).

    The exact assertion being thrown is:

    Code (csharp):
    2. [0.000006 / 21.698380] - AppCallbacks::InternalSetCursor
    3. Assertion failed on expression: 'f >= (-2147483647 - 1) && f <= 2147483647'
    5. (Filename: C:\buildslave\unity\build\Runtime/Math/FloatConversion.h Line: 105)
    And the stack trace:
    Code (csharp):
    2. >    UnityPlayer.dll!FloorfToInt(float)    Unknown
    3.     UnityPlayer.dll!RoundfToInt(float)    Unknown
    4.     UnityPlayer.dll!Input::ScalePointerPos(class Vector2f const &)    Unknown
    5.     UnityPlayer.dll!Input::PreProcess(class Vector2f const &)    Unknown
    6.     UnityPlayer.dll!UnityPlayer::AppCallbacks::DoPerformUpdateAndRender(void)    Unknown
    7.     UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender(void)    Unknown
    8.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *)    Unknown
    9.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void *)    Unknown
    10.     UnityPlayer.dll!<lambda>(void)()    Unknown
    11.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture<class <lambda_f0a3787b3da0f2012e173842f357c1e0>,void,struct Windows::Foundation::IAsyncAction ^>::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    12.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    13.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::[Windows::System::Threading::WorkItemHandler::__abi_IDelegate]::__abi_Windows_System_Threading_WorkItemHandler___abi_IDelegate____abi_Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    14.     threadpoolwinrt.dll!6c804c6f()    Unknown
    15.     [Frames below may be incorrect and/or missing, no symbols loaded for threadpoolwinrt.dll]  
    16.     threadpoolwinrt.dll!6c80aff6()    Unknown
    17.     ntdll.dll!77cce981()    Unknown
    18.     ntdll.dll!77cce941()    Unknown
    I've tried to create a smaller repro project but have had no luck so far in finding the exact cause. The stack trace seems to hint at scaling the mouse pointer position. I realise there's no mouse available on the HoloLens but this seems to trigger immediately when the emulator is in focus and switched to keyboard and mouse input for debugging purposes.

    Suffice to say this also happens on an actual device.
  2. Tautvydas-Zilys


    Unity Technologies

    Jul 25, 2013
    We'd love a bug report on this: even submitting your full big project is better than nothing.