Reproduction steps:
1. Open the attached “repro-project“
2. Open the “Assets/OutdoorsScene.unity“ scene
3. In the Hierarchy select the “Cube“ GameObject
4. Enter and then exit Play Mode
5. Observe the crash
Alternatively:
1. Create and open a new project
2. In the Hierarchy window create a new empty GameObject
3. In the Project window create a new C# Script and attach it to the GameObject
4. Select the GameObject
5. Enter and then exit Play Mode
6. Observe the crash
Reproducible with: 2023.2.0b18, 2023.2.4f1, 2023.3.0a18
Not reproducible with: 2021.3.33f1, 2022.3.15f1, 2023.2.0b17
Reproduced on: Windows 10, Windows 11 (by reporter)
Not reproducible on: No other environment tested
Notes:
1. A "Can't add script” pop-up may appear when attaching the script. If so, click “Ok“, allow it to recompile, and reattach the script.
2. The issue does not reproduce if the GameObject is not selected in the Inspector window
First few lines of the stack trace:
0x00007FFB70FA9D11 (Unity) AudioUtil_CUSTOM_HasAudioCallback
0x000002278F36C4B2 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.AudioUtil:HasAudioCallback_Injected (intptr)
0x000002278F36C323 (Mono JIT Code) UnityEditor.AudioUtil:HasAudioCallback (UnityEngine.MonoBehaviour)
0x000002278E163E6B (Mono JIT Code) UnityEditor.GenericInspector:CreateInspectorGUI ()
0x000002276E152F06 (Mono JIT Code) UnityEditor.UIElements.InspectorElement:CreateInspectorElementUsingUIToolkit (UnityEditor.Editor)