Search Issue Tracker
Won't Fix
Votes
0
Found in
6000.2.7f1
6000.3.0b4
6000.4.0a1
Issue ID
UUM-121303
Regression
No
Crash on Coroutine::CleanupCoroutineGC when assigning a Coroutine instance using FormatterServices.GetUninitializedObject
Steps to reproduce:
1. Open the “user’s attached project”
2. Open “SampleScene”
3. Go to “Window/General/Test Runner” and open the EditorMode tab
4. Press the “Run All” button at the bottom right of the window
5. Observe the crash
Reproducible with versions: 6000.2.7f1, 6000.3.0b4, 6000.4.0a1
Couldn’t test with versions: 6000.0.59f1 (compiler errors)
Reproducible on: macOS 15.6.1 (M1 Max), Windows 10 (by the user)
Not reproducible on: no other environment tested
Note: Also reproducible outside of the Test environment
First few lines of StackTrace:
0x00007FFC604D0960 (Unity) Coroutine::CleanupCoroutineGC
0x00007FFC5F64C9FD (Unity) Coroutine_CUSTOM_ReleaseCoroutine
0x000001E8B5AEF70A (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Coroutine:ReleaseCoroutine (intptr)
0x000001E8B5AEF613 (Mono JIT Code) UnityEngine.Coroutine:Finalize ()
0x000001E8B59FBE2C (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_virtual_void_{}this{}_ (object,intptr,intptr,intptr)
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
Creating a Coroutine using `FormatterServices.GetUninitializedObject()` is not supported. It creates an uninitialized object with no native backing resulting in the observed crashes.
Coroutines should only be created using StartCoroutine on a GameObject.
To get Coroutines to work in tests you will need to make the test a `[UnityTest]` instead of a normal `[Test]`.