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

Hierarchy related asserts on save...

Discussion in 'Windows' started by WoodyPWX, Apr 13, 2018.

  1. WoodyPWX

    WoodyPWX

    Joined:
    Aug 11, 2013
    Posts:
    1
    Hello there,
    could anyone please explain the meaning of the following assert? It happens a lot during scene save in my debug version, so I would like to now how dangerous it is and where should I look for an issue with our assets.
    Thanks!
    Regards,
    Tomas

    Code (CSharp):
    1. Assertion failed: Assertion failed on expression: '(hierarchy.combinedSystemChanged | hierarchy.systemChanged[index]) == (hierarchy.combinedSystemChanged | gHasChangedDeprecatedSystem.Mask())'
    2.  
    3. UnityEngine.Object:DestroyImmediate(Object, Boolean)
    4. UnityEngine.Object:DestroyImmediate(Object) (at D:/Unity-source/2017.3/artifacts/generated/common/runtime/UnityEngineObjectBindings.gen.cs:92)
    5. TemporyBoundaryGizmo`1:DestroyAllGizmos() (at Assets/frameworks/sceneFramework/scripts/TemporyBoundaryGizmo.cs:162)
    6. TemporyGizmos:RemoveTemporyGizmos() (at Assets/frameworks/sceneFramework/scripts/SceneRoot.cs:40)
    7. SceneFrameworkSave:OnSaveScene() (at Assets/moonEditor/SceneFrameworkSave.cs:151)
    8. SceneFrameworkSave:OnWillSaveAssets(String[]) (at Assets/moonEditor/SceneFrameworkSave.cs:24)
    9. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    10. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    11. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    12. UnityEditor.AssetModificationProcessorInternal:OnWillSaveAssets(String[], String[]&, String[]&, Int32) (at D:/Unity-source/2017.3/Editor/Mono/AssetModificationProcessor.cs:147)
    13. [D:/Unity-source/2017.3/Runtime/Transform/Transform.cpp line 1834]
    14.  
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Any assert you encounter is generally a bug in Unity. We'd like a bug report. I'll ask relevant people to see how dangerous failing this assert is.
     
  3. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    @Tautvydas-Zilys This assert is failing for us on Unity 2017.4.2f2 in UWP builds only, in a call to someTransform.SetParent(null). It also causes the build to crash (Unhandled win32 exception).

    Unfortunately, creating a repro project for this is very time consuming since it only happens in UWP builds and those are a bit of a pain. :)

    Is there a bug report created for this anywhere? If we find anything about this we'll let you know. We need it to not crash. ;)

    This is the output info:
     
    Last edited: May 7, 2018
  4. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    So... it seems that the assert failure and crash don't happen if you play the UWP build in Release mode instead of Debug mode. At least in our case. It only took 5 and a half hours of boring builds to find this... x) We randomly decided to make a Release build and the error was gone.

    Yay? :)
     
    lindsaytalbot likes this.
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Asserts are disabled in release builds - it doesn't mean that the error went away, though. Unfortunately it's not clear what the impact on this is, and we don't have any existing bug reports on this :(.
     
  6. lindsaytalbot

    lindsaytalbot

    Joined:
    Sep 11, 2015
    Posts:
    28
    I was getting this bug in 2017.2.0p2 whenever I called Instantiate with a parent included. Instantiating prefabs without parents and setting them after fixed most occurrences of this bug but it still showed up in one other place that I am unable to work out.

    Moving to 2017.3.1p4 fixed that particular instance but created another assert crash elsewhere for seemingly no reason. Going to try release build and 2018.1
     
  7. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    We understand that the error hasn't gone away, but negative consequences don't seem to exist so far. The functionality that was failing now works as expected and doesn't crash. We are not totally confident about it, though.

    We found a small repro project to be hard to create. :( We have to take away everything from the project until we can reproduce it with a minimal set of things, but these are UWP builds, which are VERY time consuming to make after each change.

    I'll try to make one later today, but can't promise much. :)
     
  8. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Oh and we haven't tried 2018 yet, due to incompatibilities being expected and our app being very close to release. :)
     
  9. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    @Tautvydas-Zilys After some more pain I submitted a bug report. In our case it only happens on UWP builds but it should help. :)
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Thanks, do you have a case #? I don't need the link, just the number.
     
  11. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Sure, it's 1035793.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    We'll take a look.
     
  13. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
    Seeing this in 2018.1.2f1 as well.
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    This turned out to be an incorrect assert. It's totally harmless, though somewhat annoying. We have a fix in the pipeline.