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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.