Search Issue Tracker
Fixed
Fixed in 6000.5.0a1
Votes
0
Found in
2021.3.34f1
2022.3.17f1
2023.2.5f1
2023.3.0b1
6000.0.0b11
6000.1.0a7
6000.2.0a1
6000.5.0a1
7000.0.0a1
Issue ID
UUM-59991
Regression
No
Crash on Component_Get_Custom_PropTransform when using MemberwiseClone() and destroying the GameObject
Reproduction steps:
1. Open the attached project “BugCrashTesting.zip”
2. Open “SampleScene”
3. Enter and exit Play Mode
4. Observe crash
Reproducible with: 2021.3.34f1, 2022.3.17f1, 2023.2.5f1, 2023.3.0b1
Reproducible on: macOS Sonoma 14.0 (Intel), Windows 10 (by the reporter)
Not reproducible on: no other environment tested
First few lines of Stack Trace:
{noformat}#0 0x0000010b5d7935 in Component_Get_Custom_PropTransform(ScriptingBackendNativeObjectPtrOpaque)
#1 0x00000173a4a7c9 in (wrapper managed-to-native) UnityEngine.Component:get_transform (UnityEngine.Component) [{0x7fae939cfa00} + 0xf9] (0x173a4a6d0 0x173a4a8c0) [0x159542a80 - Unity Child Domain]
#2 0x00000161eab7fc in mono_jit_runtime_invoke
#3 0x00000162061183 in do_runtime_invoke
#4 0x000001620610c0 in mono_runtime_invoke
#5 0x0000010c290337 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr, bool){noformat}
Note: the crash happens in the {{SpawnedObj.cs}} script, at line 11
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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note (fix version 6000.5.0a1):
Forbid calling System.Object.MemberwiseClone on UnityEngine.Objects as the resultant object will be an orphaned Managed copy of the original referencing the same Native object instance.
A Many to One relationship between Managed and Native Objects is unexpected and will lead to erroneous behaviour and eventually, a crash