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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
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.