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

Serialization

-

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)]

  1. 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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.