Search Issue Tracker
By Design
Votes
0
Found in
2021.3.39f1
2022.3.33f1
6000.0.6f1
Issue ID
UUM-73951
Regression
No
StackOverflowException is thrown when dragging the window in the Play mode while using Animator.Update
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/SampleScene.unity” Scene
3. Enter the Play mode
4. Drag the Console window around
5. Observe the Console window
Expected result: No errors are thrown
Actual result: “StackOverflowException: The requested operation caused a stack overflow.” is thrown
Reproducible with: 2021.3.39f1, 2022.3.33f1, 6000.0.6f1
Reproducible on: Windows 11
Not reproducible on: No other environment tested
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 UndoManager::RegisterUndoInternal when applying added GameObjects to a Prefab
- [Asset Bundles] A new bundle hash is not generated when the name of a serialized field is changed
- Icon section shows incomplete message and unusable check box in Build Profiles and Player Settings window instead of “Not applicable for this platform” for Dedicated Server Platform
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
Resolution Note:
This is a user error.
Animator.Update triggers an update of the state machine. This, in turn will call the StateMachineBehaviour.OnUpdate callback on any state machine behaviour that is attached to the current state.
In the repro project, the StateMachineBehaviour.OnUpdate callback is calling Animator.Update, resulting in an infinite callback loop. At some point, we run out of stack space, and the StackOverflowException is thrown.
If the Animator.Update call is removed from the StateMachineBehaviour, the exception is no longer thrown.