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
- 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 (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