Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Issue: Assertion failed on expression: 'i < data->hierarchies->size()'

Discussion in 'Editor & General Support' started by moco2k, Jul 28, 2017.

  1. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Hey everyone,

    after some time playing my project in the unity editor, the consoles starts to spam the following error message:

    Assertion failed: In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first.


    Or, with a dedicated test scene setup, I also receive this message:

    Assertion failed: Assertion failed on expression: 'i < data->hierarchies->size()'

    After I stop play mode, the unity editor crashes in many cases.
    From my current testing experience,s chances are that both assertion error messages might relate to the same root cause.

    I know there are some other threads on assertion errors already, but none of the other topics seems to fit my case nor provide a solution for the problem. So, I really hope that someone can help me out in order to find the root cause, or how to properly debug this issue, respectively find out which part of the engine is causing this so I can better nail it down. Currently, I think it might a bug in the unity engine that occurs in rare situations and which depends on scene complexity.

    I'm using the latest Unity 2017.1.0p2 (64-bit) on Windows 7.

    Below, I've added some of the assertion logs I experienced and also an Editor.log.
    I've never seen these issues with Unity 5.6 and it seems that it started to appear with the 2017 version.

    [Update 2017-07-29]
    - The issue seems to be dependent on scene complexity, respectively on complexity of the hierarchy. I think a more complex scene makes it appear more quickly.


    Assertion failed: In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first.
    0x000000014098A59B (Unity) StackWalker::GetCurrentCallstack
    0x000000014098DABF (Unity) StackWalker::ShowCallstack
    0x0000000140D369B0 (Unity) GetStacktrace
    0x000000014107BE66 (Unity) DebugStringToFile
    0x000000014107C63C (Unity) DebugStringToFile
    0x0000000140F24C63 (Unity) Renderer::AssertIsTransformInfoUpToDate
    0x00000001412CAB80 (Unity) ParticleSystemRenderer:: PrepareRenderNodes<1>
    0x0000000140CAC7E8 (Unity) ExecuteRenderQueue
    0x0000000140CAC8BC (Unity) ExecuteRenderQueueJob
    0x0000000141079AF3 (Unity) JobQueue::Exec
    0x0000000141079D49 (Unity) JobQueue::ExecuteJobFromHighPriorityStack
    0x0000000141079DD8 (Unity) JobQueue:: ProcessJobs
    0x0000000141079ECE (Unity) JobQueue::WorkLoop
    0x00000001415B028C (Unity) Thread::RunThreadWrapper
    0x00000000779259CD (kernel32) BaseThreadInitThunk
    0x0000000077B5A561 (ntdll) RtlUserThreadStart

    Assertion failed: In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first.
    0x000000014098A59B (Unity) StackWalker::GetCurrentCallstack
    0x000000014098DABF (Unity) StackWalker::ShowCallstack
    0x0000000140D369B0 (Unity) GetStacktrace
    0x000000014107BE66 (Unity) DebugStringToFile
    0x000000014107C63C (Unity) DebugStringToFile
    0x0000000140F24C63 (Unity) Renderer::AssertIsTransformInfoUpToDate
    0x0000000140FB1099 (Unity) PrepareMeshRenderNodes<1>
    0x0000000140CAC7E8 (Unity) ExecuteRenderQueue
    0x0000000140CAC8BC (Unity) ExecuteRenderQueueJob
    0x0000000141079AF3 (Unity) JobQueue::Exec
    0x0000000141078AE9 (Unity) JobQueue::Steal
    0x0000000141078EA7 (Unity) JobQueue::ExecuteJobFromQueue
    0x0000000141079DE4 (Unity) JobQueue:: ProcessJobs
    0x0000000141079ECE (Unity) JobQueue::WorkLoop
    0x00000001415B028C (Unity) Thread::RunThreadWrapper
    0x00000000779259CD (kernel32) BaseThreadInitThunk
    0x0000000077B5A561 (ntdll) RtlUserThreadStart

    Assertion failed: Assertion failed on expression: 'i < data->hierarchies->size()'
    0x000000014098A59B (Unity) StackWalker::GetCurrentCallstack
    0x000000014098DABF (Unity) StackWalker::ShowCallstack
    0x0000000140D369B0 (Unity) GetStacktrace
    0x000000014107BE66 (Unity) DebugStringToFile
    0x000000014107C63C (Unity) DebugStringToFile
    0x00000001415B75CA (Unity) BatchJob
    0x0000000141079AF9 (Unity) JobQueue::Exec
    0x0000000141078AE9 (Unity) JobQueue::Steal
    0x000000014107A1A3 (Unity) JobQueue::WaitForJobGroup
    0x0000000141076703 (Unity) CompleteFenceInternal
    0x00000001415C0177 (Unity) BatchCombineJob
    0x00000001415C0706 (Unity) TransformChangeDispatch::GetAndClearChangedAsBatchedJobs_Internal
    0x0000000140F58CA8 (Unity) TrailRenderer::prepareDispatchUpdate
    0x0000000140F217F2 (Unity) RendererUpdateManager::UpdateAll
    0x0000000140CA3E81 (Unity) RenderManager::UpdateAllRenderers
    0x0000000140C65FD5 (Unity) Camera::CustomRender
    0x0000000140C6725C (Unity) Camera::Render
    0x0000000140C674BB (Unity) Camera::Render
    0x0000000140CA3E00 (Unity) DoRenderScreenCamera
    0x0000000140CC20E6 (Unity) RenderManager::RenderCameras
    0x00000001401EF686 (Unity) RepaintController::RenderGameViewCameras
    0x000000014176E9E1 (Unity) EditorGUIUtility_CUSTOM_INTERNAL_CALL_RenderGameViewCamerasInternal
    0x00000000428054B4 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.EditorGUIUtility:INTERNAL_CALL_RenderGameViewCamerasInternal (UnityEngine.RenderTexture,int,UnityEngine.Rect&,UnityEngine.Vector2&,bool)
    0x0000000042805384 (Mono JIT Code) [EditorGUIUtilityBindings.gen.cs:642] UnityEditor.EditorGUIUtility:RenderGameViewCamerasInternal (UnityEngine.RenderTexture,int,UnityEngine.Rect,UnityEngine.Vector2,bool)
    0x00000000427269DE (Mono JIT Code) [GameView.cs:747] UnityEditor.GameView:OnGUI ()
    0x000000000B506CF2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x000007FEE57E5B67 (mono) [mini.c:4937] mono_jit_runtime_invoke
    0x000007FEE5738731 (mono) [object.c:2623] mono_runtime_invoke
    0x000007FEE573EC3F (mono) [object.c:3838] mono_runtime_invoke_array
    0x000007FEE56FD0F7 (mono) [icall.c:2750] ves_icall_InternalInvoke
    0x000000000B4D02D7 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    0x000000000B4CE432 (Mono JIT Code) [MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    0x000000003FDCDBEF (Mono JIT Code) [MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[])
    0x000000003FE27855 (Mono JIT Code) [HostView.cs:272] UnityEditor.HostView:Invoke (string,object)
    0x000000003FE276FA (Mono JIT Code) [HostView.cs:265] UnityEditor.HostView:Invoke (string)
    0x0000000042721843 (Mono JIT Code) [HostView.cs:232] UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect)
    0x00000000404EF45B (Mono JIT Code) [DockArea.cs:827] UnityEditor.MaximizedHostView:OnGUI ()
    0x000000000B506CF2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x000007FEE57E5B67 (mono) [mini.c:4937] mono_jit_runtime_invoke
    0x000007FEE5738731 (mono) [object.c:2623] mono_runtime_invoke
    0x000000014140BDC5 (Unity) scripting_method_invoke
    0x0000000141403F61 (Unity) ScriptingInvocation::Invoke
    0x000000014103DF03 (Unity) MonoBehaviourDoGUI
    0x00000001410307A0 (Unity) IMGUIModule::MonoBehaviourDoGUI
    0x00000001411760DD (Unity) MonoBehaviour::DoGUI
    0x00000001400299D6 (Unity) GUIView::OnInputEvent
    0x00000001401B0CE3 (Unity) GUIView::processInputEvent
    0x0000000140006D76 (Unity) GUIView::DoPaint
    0x0000000140013550 (Unity) GUIView::RepaintAll
    0x0000000140108E47 (Unity) Application::UpdateScene
    0x000000014010D1DF (Unity) Application::UpdateSceneIfNeeded
    0x000000014013126F (Unity) Application::TickTimer
    0x0000000141A8B1DD (Unity) MainMessageLoop
    0x0000000141A8CBA7 (Unity) WinMain
    0x0000000141CEFB98 (Unity) __tmainCRTStartup
    0x00000000775B59CD (kernel32) BaseThreadInitThunk
    0x00000000776EA561 (ntdll) RtlUserThreadStart

    Any help is very much appreciated.
    Thanks in advance!
     

    Attached Files:

    Last edited: Aug 1, 2017
  2. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Update:
    I've spent more time with debugging and I have created a clean test project. In this project, I run a loop which continuously spawns the Ethan standard 3rd person character, equipped with a test weapon model (just a cube with a point light) and no further components but an animator attached. Then, nearly immediately after spawning, after a very, very short interval, the test script destroys the character and spawns it again. And so on.

    Now, usually, if I let the test scene run for about 5-10 minutes in editor play mode, the assertion error message pops up after some minutes. So, eventually, I was able to reproduce the assertion issue with the test project and with a very simple test scene setup. This provides evidence that it is indeed an internal Unity bug.

    However, the issue is tricky because it seems that it does not appear every time I run the test scene, or, at least, not after a deterministic time, which makes reproduction harder. However, if I run the very same testing loop in my actual game scene, which is much more complex than the test scene, the assertion shows up much more quickly and I can usually reproduce the issue within a few seconds most of the time. So, using a more complex scene setup should improve chances to successfully reproduce this issue.
     
    Last edited: Nov 6, 2017
  3. Chimooo

    Chimooo

    Joined:
    Oct 23, 2015
    Posts:
    4
    Hi! I just had that error today appearing randomly. I was not sure how to replicate it. Did it cause your game to crash or to behave improperly? (I haven't experienced that but I was wondering if it would be safe to just ignore it)
     
  4. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    [Update]
    After some additional tests with game builds, I can confirm that this issue also can cause builds to crash.
    It's quite servere and I would expect that much more people would be facing this.. On the other side, it seems to only happen under rare circumstances.
     
    Last edited: Aug 8, 2017
  5. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    moco2k likes this.
  6. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Thanks. I have also received this info from the QA team. When the fix is there, I will retest and post here about the result.
     
  7. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Just a quick note to let you know that I still experience this issue with 2017.2.0f3.
    So, I presume that it will be fixed in one of the upcoming patches.
     
  8. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @moco2k

    Thanks for the heads up! And yes, you're right. For f3, it was a risky change and as I had written and as you rightfully assumed, the fix will be available in one of the next patch releases. The fix is already merged to 2017.3 beta.
     
    moco2k likes this.
  9. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Thanks kemalakay for the quick response and for the info! This is good to know because when just looking at the issue ticket one could easily assume that this issue is supposed to be fixed in the initial release of 2017.2, which is not the case though.

    [Update] Okay, the ticket has been updated and now refers to 2017.3 for the fix.
     
    Last edited: Nov 6, 2017
    kemalakay likes this.
  10. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
  11. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Hey,
    so far, I have not encountered this issue with the latest patch 2017.2.0p2 so I think it might be fixed. The patch release notes do not provide any information on the related ticket #930408 though.

    However, after updating to 2017.2.0p2, unfortunately I've been experiencing a completely new assertion issue.
    New thread about it here.
     
    Last edited: Nov 28, 2017
  12. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Hi @kemalakay,

    today, I've encountered this issue again, this time with 2017.2.1f1. As noted in the post earlier, I've not ever seen this issue with 2017.2.0p2 though. So, maybe the fix did not get included in 2017.2.1 for some reason. I don't know..

    I'm starting to get a little desperate because now it seems that there are 2 assertion crash bugs already (see previous post) which both are full showstoppers..

    Update: Good news! 2017.3.0f3 does include the fix. :)
     
    Last edited: Dec 21, 2017
unityunity