Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.4.0f1
2019.2.0a1
2019.2.5f1
2019.3.0a1
2020.1.0a1
Issue ID
1184635
Regression
No
Assert Exceptions in Finalizers are not logged to Console
Steps to reproduce:
1. Download attached project
2. Open 'SampleScene' scene
3. Enter play mode
Actual results: Notice that the Assertion Exceptionisn't printed.
AssertionException: Assertion failure. Value was False
Expected: True
~AssertFinalizedClass(True)
at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00000] in <00000000000000000000000000000000>:0
at AssertFinalizedClass.Finalize () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
System.Xml.OnDefaultAttributeUseDelegate:Invoke(IDtdDefaultAttributeInfo, XmlTextReaderImpl)
Reproduced with: 2020.1.0a4, 2019.3.0b4, 2019.2.6f1, 2018.4.9f1, 2017.4.32f1
Note:
- This AssertionException is printed in Standalone, UWP, iOS players.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on SpriteAtlas::PopulatePackedTexturesAndRenderData when changing Import Settings on a Sprite that has been added to a Sprite Atlas while in PlayMode
- Empty lists can be applied in Additional Compiler Argument list in Project Settings
- [Vulkan][OpenXR] SRP Foveation Regions Not Centered when eye-tracking is not used
- Long Color Library name overflows outside input field bounds
- Shader Graph validation and Metal threadgroup memory warnings thrown when installing HDRP package in Universal 3D Template
Resolution Note:
Assert logic can either Debug.Log, and continue, or raise an exception and stop
Finalizer calls are called by Mono when the GC is collecting. and unhandled Exceptions do not get outputted to the log when they are in Finalizers.
Exceptions should not be thrown in the Finalizer. If one wants Assert in Finalizers, always set the raiseExceptions to false before.