Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.48f1
2021.3.25f1
2022.2.16f1
2023.1.0b16
2023.2.0a13
2023.3.0a3
6000.0.0b11
Issue ID
UUM-35574
Regression
No
Crash on AddComponentUnchecked when running tests and DestroyImmediate() is used
Reproduction steps:
1. Open the attached project “CrashRepro“
2. Open the Test Runner window
3. Click on the “Run All” button
Expected result: Tests run
Actual result: Editor crashes
Reproducible with: 2020.3.48f1, 2021.3.25f1, 2022.2.16f1, 2023.1.0b16, 2023.2.0a13
Reproducible on: Windows 10
First few lines of the stack trace:
{noformat}0x00007ff6da603c8f (Unity) AddComponentUnchecked
0x00007ff6da6036f7 (Unity) AddComponent
0x00007ff6da89fdf6 (Unity) MonoAddComponentWithType
0x00007ff6d9adf1f7 (Unity) GameObject_CUSTOM_Internal_AddComponentWithType
0x00000248ffa420cc (Mono JIT Code) (wrapper managed-to-native) UnityEngine.GameObject:Internal_AddComponentWithType (UnityEngine.GameObject,System.Type){noformat}
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
- [Android] Stage information is not logged when Log Shader Compilation is enabled
- [Vulkan] The memory allocation increases rapidly when there are multiple (three or more) Real-Time Reflection Probes in the Scene
- [macOS] Library folder of the opened project can be deleted which leads to the crash
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
Resolution Note:
Issue is related to the incorrect usage of Singletons in the user's project. To ensure the objects in your code have a proper lifecycle, make sure you:
1. Use Destroy() instead of DestroyImmediate() in the runtime.
2. Do a cleanup after your tests finish executing.