How to reproduce:
- Open the attached "IN-150967" project
- In the menu bar, select "Bug Repro" > "AnimatorController null MonoScript" > "1. CrashCreateNewStateMachineBehaviour"
- Observe the crash
Reproducible with: 6000.3.0a6 (6966ed4b28e1), 6000.3.23f1, 6000.5.10f1, 6000.6.0b10, 6000.7.0a5
Could not test with: 6000.0.0f1, 6000.0.82f1, 6000.3.0a5 (36d7e9fd6645) (Compilation errors: AnimatorController.CreateNewStateMachineBehaviour does not exist in this stream)
Reproducible on: Ubuntu 24.04 LTS, Ubuntu 26.04 LTS (by user), Windows 10 Pro
Not reproducible on: No other environments tested
Notes: Reproducible with -batchmode -nographics -executeMethod AnimatorControllerNullRepro.CrashCreateNewStateMachineBehaviour
First few lines of the stack trace:
#0 MonoScript::GetScriptTypeWasJustCreatedFromComponentMenu() const ()
#1 CreateStateMachineBehaviour(MonoScript*) ()
#2 AnimatorControllerBindings::Internal_CreateNewStateMachineBehaviour(MonoScript*) ()
#3 AnimatorController_CUSTOM_CreateNewStateMachineBehaviour(void*, EntityId&) ()
#4 0x00000040d3fe44 in (wrapper managed-to-native) UnityEditor.Animations.AnimatorController:CreateNewStateMachineBehaviour_Injected (intptr,UnityEngine.EntityId&)