Search Issue Tracker
By Design
Votes
0
Found in
2021.3.39f1
2022.3.33f1
6000.0.6f1
7000.0.0a1
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
- Reference to a deleted GameObject becomes "None" instead of "Missing" when the GameObject is restored with undo after entering and exiting Play Mode
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
- Particle System Curve presets can't be scrolled and some of them can't be selected if window is too narrow to fit them all
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.