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:
[0.000006 / 21.698380] - AppCallbacks::InternalSetCursor
Assertion failed on expression: 'f >= (-2147483647 - 1) && f <= 2147483647'
(Filename: C:\buildslave\unity\build\Runtime/Math/FloatConversion.h Line: 105)
And the stack trace:
> UnityPlayer.dll!FloorfToInt(float) Unknown
UnityPlayer.dll!RoundfToInt(float) Unknown
UnityPlayer.dll!Input::ScalePointerPos(class Vector2f const &) Unknown
UnityPlayer.dll!Input::PreProcess(class Vector2f const &) Unknown
UnityPlayer.dll!UnityPlayer::AppCallbacks::smile:oPerformUpdateAndRender(void) Unknown
UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender(void) Unknown
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *) Unknown
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void *) Unknown
UnityPlayer.dll!<lambda>(void)() Unknown
UnityPlayer.dll!Platform::smile:etails::__abi_FunctorCapture<class <lambda_f0a3787b3da0f2012e173842f357c1e0>,void,struct Windows::Foundation::IAsyncAction ^>::Invoke(struct Windows::Foundation::IAsyncAction ^) Unknown
UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(struct Windows::Foundation::IAsyncAction ^) Unknown
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
threadpoolwinrt.dll!6c804c6f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for threadpoolwinrt.dll]
threadpoolwinrt.dll!6c80aff6() Unknown
ntdll.dll!77cce981() Unknown
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.