Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

"index < m_size" Crash

Discussion in 'Windows' started by jotapeh_, Dec 3, 2015.

  1. jotapeh_

    jotapeh_

    Joined:
    Nov 16, 2012
    Posts:
    45
    I've seen this error before on Windows Store (Phone & Windows RT,) but it generally wasn't a fatal error. It was sufficient usually to switch to Master release mode and ignore the error. It's not present on any other platforms.

    With the latest app I'm porting in Unity, I now consistently receive this error message in the console prior to a hard crash on Windows Phone. It's generally preceded by an unused memory cleanup:

    Code (csharp):
    1.  
    2. Unloading 43 unused Assets to reduce memory usage. Loaded Objects now: 10718. Operation took 968.524536 ms.
    3.  
    4. System memory in use: 39.0 MB.
    5.  
    6. index < m_size
    7.  
    8. (Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h Line: 303)
    9.  
    I can't find any documentation on where this log message comes from, I'd be grateful to know where in the Unity code this message can be produced as I have no idea where to start looking nor can I seem to catch this with a breakpoint.
     
  2. jotapeh_

    jotapeh_

    Joined:
    Nov 16, 2012
    Posts:
    45
    I may have managed to find the call stack for the exception, I think?

    Code (csharp):
    1.  
    2. >    UnityPlayer.dll!dynamic_array<struct SceneNode,4>::operator[](unsigned int)    Unknown
    3.     UnityPlayer.dll!Unity::RendererScene::NotifyInvisible(void)    Unknown
    4.     UnityPlayer.dll!PlayerLoop(bool,bool,class IHookEvent *)    Unknown
    5.     UnityPlayer.dll!metro::MainLoop(bool)    Unknown
    6.     UnityPlayer.dll!UnityPlayer::AppCallbacks::MetroMainLoop(void)    Unknown
    7.     UnityPlayer.dll!UnityPlayer::AppCallbacks::DoPerformUpdateAndRender(void)    Unknown
    8.     UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender(void)    Unknown
    9.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *)    Unknown
    10.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void *)    Unknown
    11.     UnityPlayer.dll!<lambda>(void)()    Unknown
    12.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture<class <lambda_2aa9310133913358153453d9e5d5d831>,void,struct Windows::Foundation::IAsyncAction ^>::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    13.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    14.     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
    15.     THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::CommonWorkCallback(void)    Unknown
    16.     THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::TimeSlicedCallback(void *)    Unknown
    17.     NTDLL.DLL!RtlUserThreadStart()    Unknown
    18.  
    edit: it's quickly followed by another exception:

    Code (csharp):
    1.  
    2. >    UnityPlayer.dll!dynamic_array<unsigned char,1>::operator[](unsigned int)    Unknown
    3.     UnityPlayer.dll!Unity::RendererScene::NotifyInvisible(void)    Unknown
    4.     UnityPlayer.dll!PlayerLoop(bool,bool,class IHookEvent *)    Unknown
    5.     UnityPlayer.dll!metro::MainLoop(bool)    Unknown
    6.     UnityPlayer.dll!UnityPlayer::AppCallbacks::MetroMainLoop(void)    Unknown
    7.     UnityPlayer.dll!UnityPlayer::AppCallbacks::DoPerformUpdateAndRender(void)    Unknown
    8.     UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender(void)    Unknown
    9.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *)    Unknown
    10.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void *)    Unknown
    11.     UnityPlayer.dll!<lambda>(void)()    Unknown
    12.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture<class <lambda_2aa9310133913358153453d9e5d5d831>,void,struct Windows::Foundation::IAsyncAction ^>::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    13.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(struct Windows::Foundation::IAsyncAction ^)    Unknown
    14.     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
    15.     THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::CommonWorkCallback(void)    Unknown
    16.     THREADPOOLWINRT.DLL!Windows::System::Threading::CThreadPoolWorkItem::TimeSlicedCallback(void *)    Unknown
    17.     NTDLL.DLL!RtlUserThreadStart()    Unknown
    18.  
     
  3. lasercannon

    lasercannon

    Joined:
    Nov 29, 2012
    Posts:
    80
    Having this same exact error on Windows 10 Universal. It happens whether I'm running XAML or D3D, or .NET or IL2CPP. No idea where it's coming from.
     
  4. lasercannon

    lasercannon

    Joined:
    Nov 29, 2012
    Posts:
    80
    After poking around in the debugger a bit I found a callstack. It looks like it happens in GameObject.Instantiate, specifically when instantiating something with an Animator.

    Btw, I also had this issue on the Xbox One, and I think I fixed it by updating Unity. Obviously not an option with UWP and IL2CPP. :p

    The top of the callstack:

    UnityPlayer.dll!dynamic_array<unsigned char,1>::eek:perator[](unsigned __int64) Unknown
    UnityPlayer.dll!UnityEngine::Animation::RegisterAvatarBindingObjects(struct UnityEngine::Animation::AvatarBindingConstant *) Unknown
    UnityPlayer.dll!UnityEngine::Animation::CreateAnimatorGenericBindingsOpt(struct UnityEngine::Animation::AnimationSetBindings const &,class Transform &,struct mecanim::animation::AvatarConstant const *,struct mecanim::animation::ControllerConstant const *,struct UnityEngine::Animation::AvatarBindingConstant const *,bool,class mecanim::memory::Allocator &,class Animator &) Unknown
    UnityPlayer.dll!Animator::SetupBindingsDataSet(struct mecanim::animation::ControllerConstant const *,struct UnityEngine::Animation::AnimationSetBindings const *,struct Animator::BindingsDataSet &,struct Animator::AvatarDataSet &) Unknown
    UnityPlayer.dll!Animator::CreateBindings(void) Unknown
    UnityPlayer.dll!Animator::CreateObject(void) Unknown
    UnityPlayer.dll!Animator::Rebind(void) Unknown
    UnityPlayer.dll!Animator::AwakeFromLoad(enum AwakeFromLoadMode) Unknown
    UnityPlayer.dll!AwakeFromLoadQueue::InvokeAwakeFromLoad(struct AwakeFromLoadQueue::Item *,unsigned int,enum AwakeFromLoadMode) Unknown
    UnityPlayer.dll!AwakeFromLoadQueue::AwakeFromLoad(enum AwakeFromLoadMode,bool) Unknown
    UnityPlayer.dll!AwakeAndActivateClonedObjects(class vector_map<int,int,struct std::less<int>,class stl_allocator<struct std::pair<int,int>,1,16> > const &) Unknown
    UnityPlayer.dll!InstantiateObject(class Object &,class Vector3f const &,class Quaternionf const &) Unknown
    UnityPlayer.dll!Object_CUSTOM_INTERNAL_CALL_Internal_InstantiateSingle(struct ReadOnlyScriptingObjectOfType<class Object>,class Vector3f const &,class Quaternionf const &) Unknown
    > UnityPlayer.dll!Object_INTERNAL_CALL_Internal_InstantiateSingle_m9_897(Object_t * __this, Object_t9_5 * ___data, Vector3_t9_54 * ___pos, Quaternion_t9_56 * ___rot, const MethodInfo * method) Line 953 C++
    UnityPlayer.dll!Object_Internal_InstantiateSingle_m9_896(Object_t * __this, Object_t9_5 * ___data, Vector3_t9_54 ___pos, Quaternion_t9_56 ___rot, const MethodInfo * method) Line 941 C++
    UnityPlayer.dll!Object_Instantiate_m9_920(Object_t * __this, Object_t9_5 * ___original, Vector3_t9_54 ___position, Quaternion_t9_56 ___rotation, const MethodInfo * method) Line 1248 C++
    UnityPlayer.dll!StaticScriptCommands_SpawnCharacter_m13_1855(Object_t * __this, String_t * ___characterID, Transform_t9_73 * ___locator, const MethodInfo * method) Line 18968 C++
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,686
    bug report please with repro project, thank you
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,521
    This is an assert firing - Unity's trying to read outside of array bounds. This is definitely a bug. We'll need a bug report in order to investigate to even tell what's causing it, though.
     
  7. lasercannon

    lasercannon

    Joined:
    Nov 29, 2012
    Posts:
    80
    Finally narrowed this down. Submitted as bug (Case 751974) with a repro project. Turns out it was only happening in debug mode, so fortunately I'm unblocked for now.
     
    -chris likes this.