Search Issue Tracker
Not Reproducible
Votes
1
Found in
2018.4
2020.1.5f1
2021.1
Issue ID
1279071
Regression
No
Crash on scripting_field_get_type when a Script has List<> of LayoutKind.Explicit struct with [FieldOffset(1)] ScriptableObject
How to reproduce:
1. Open the attached project (ExplicitLayoutCrash.zip)
2. Attach the 'NewBehaviourScript' as a Component to any GameObject in the opened Scene
Reproducible with: 2018.4.27f1, 2019.4.10f1, 2020.1.5f1, 2020.2.0b3, 2021.1.0a1
First lines of the stacktrace:
0x00007ff60e3a0a2f (Unity) scripting_field_get_type
0x00007ff60e3f64f4 (Unity) LinearCollectionField::LinearCollectionField
0x00007ff60e3acc59 (Unity) EmitSerializationCommandsForLinearCollectionField
0x00007ff60e3f6e0b (Unity) BuildSerializationCommandQueueFor
0x00007ff60e3b017b (Unity) SerializationCache::WriteQueueForTransferSignatureIntoCache
0x00007ff60e3ac549 (Unity) SerializationCache::BuildSerializationCacheFor
Notes
1. Issue doesn't reproduce with other data types: Array, ArrayList, Queue<>, Stack<>, LinkedList<>, Dictionary<>, HashSet<>
2. Issue reproduces only when [FieldOffset(>0)]
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
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Resolution Note (2021.2.X):
scripting_class_get_fields In Unity 2021.2 and 2022.1 returns a list of fields, thus this crash is no longer reproducible