SerializationAbortException: Data layout mismatch

Issue #353 resolved
Jérémy GUERY
created an issue

What happened?

When I try to duplicate a specific ScriptableObject with specifics serialized classes a serialization error appears.

How can we reproduce it?

  • Download and open the project in attachment with Unity 2017.1.0p3
  • Import Odin Inspector 1.0.6.9
  • Setup a "Skill" Scriptable Object like the picture in attachment (add a SkillBehaviourOwnerBuffable and add a BuffDenfensiveMatrix in the Buffs list)
  • Try to duplicate the ScriptableObject with Ctrl-D
  • See the error in the console

I think the property "private Guid targetGuid;" in BuffDefensiveMatrix is causing the error. When I remove that property there is no issue anymore.

SerializationAbortException: The following error was logged during serialization or deserialization: Data layout mismatch; skipping past node boundary when exiting array.
Sirenix.Serialization.DebugContext.LogError (System.String message) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Misc/SerializationConfig.cs:188)
Sirenix.Serialization.SerializationNodeDataReader.ExitArray () (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/DataReaderWriters/SerializationNodes/SerializationNodeDataReader.cs:245)
Sirenix.Serialization.ListFormatter`1[Mechanicus.Dungeon.Data.Buffs.Buff].DeserializeImplementation (System.Collections.Generic.List`1& value, IDataReader reader) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Formatters/ListFormatter.cs:88)
Sirenix.Serialization.BaseFormatter`1[System.Collections.Generic.List`1[Mechanicus.Dungeon.Data.Buffs.Buff]].Deserialize (IDataReader reader) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Formatters/BaseFormatter.cs:172)
Rethrow as SerializationAbortException: Deserialization of type 'Mechanicus.Dungeon.Data.Skills.Skill' aborted.
Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, IDataReader reader) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:1453)
Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context, Boolean isPrefabData, System.Collections.Generic.List`1 prefabInstanceUnityObjects) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:1234)
Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context) (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:994)
Sirenix.OdinInspector.SerializedScriptableObject.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () (at F:/Sirenix/Sirenix Solution/Sirenix.Serialization/Unity Integration/SerializedScriptableObject.cs:24)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr

What version of Unity are you using?

Unity 2017.1.0p3

What version of Odin are you using? (See "Tools > Odin Inspector > About")

Odin Inspector 1.0.6.9

Do you have Editor Only mode enabled?

No

What operating system are you on?

Windows 10 64bits

Thanks!

Comments (9)

  1. Joel Clark

    My team is hitting the same issue, but it's only happening for us on iOS builds. If there's been any update to this issue, I'd be glad to hear it!

    For reference, we're on Unity 2018.2.0f2 Odin Inspector 1.0.6.9 Editor Only mode is off

  2. Joel Clark

    Still debugging this issue, as it's blocking our iOS builds entirely. From what I've found, this issue happens specifically on Dictionaries on SerializedScriptableObjects (more specifically on dictionaries of string to any class). We've run the AOT Generation, the Dictionaries appear in the list of supported types, and we generate the DLL, but this error causes the build to crash on startup. Here's the full error we're getting, for reference.

    SerializationAbortException: The following error was logged during serialization or deserialization: Data layout mismatch; skipping past array boundary when exiting node.
      at Sirenix.Serialization.DebugContext.LogError (System.String message) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.BinaryDataReader.ExitNode () [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.ComplexTypeSerializer`1[T].ReadValue (Sirenix.Serialization.IDataReader reader) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.IDataReader reader) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1[UnityEngine.Object]& referencedUnityObjects, Sirenix.Serialization.DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context, System.Boolean isPrefabData, System.Collections.Generic.List`1[T] prefabInstanceUnityObjects) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.OdinInspector.SerializedScriptableObject.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <00000000000000000000000000000000>:0 
      at UnityEngine.Resources.Load[T] (System.String path) [0x00000] in <00000000000000000000000000000000>:0 
      at GlobalData.get_AnimationMasterList () [0x00000] in <00000000000000000000000000000000>:0 
      at GameWorld.RuntimeInit (System.Boolean fromLevelCreation) [0x00000] in <00000000000000000000000000000000>:0 
    Rethrow as SerializationAbortException: Deserialization of type 'DeckAnimationMasterList' aborted.
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.IDataReader reader) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, System.Byte[]& bytes, System.Collections.Generic.List`1[UnityEngine.Object]& referencedUnityObjects, Sirenix.Serialization.DataFormat format, Sirenix.Serialization.DeserializationContext context) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context, System.Boolean isPrefabData, System.Collections.Generic.List`1[T] prefabInstanceUnityObjects) [0x00000] in <00000000000000000000000000000000>:0 
      at Sirenix.OdinInspector.SerializedScriptableObject.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <00000000000000000000000000000000>:0 
      at UnityEngine.Resources.Load[T] (System.String path) [0x00000] in <00000000000000000000000000000000>:0 
      at GlobalData.get_AnimationMasterList () [0x00000] in <00000000000000000000000000000000>:0 
      at GameWorld.RuntimeInit (System.Boolean fromLevelCreation) [0x00000] in <00000000000000000000000000000000>:0 
    UnityEngine.Resources:Load(String)
    GlobalData:get_AnimationMasterList()
    GameWorld:RuntimeInit(Boolean)
    
  3. Tor Esa Vestergaard

    Sorry I haven't been more active on this issue of late - we've been swamped with the impending release of Odin 2.0 and it simply passed me by. Thanks for sticking with it!

    This is a very difficult error to debug, and I've not yet managed to reproduce it reliably on my own hardware. It seems a strange sort of error, if it only happens on iOS but is related to faults in the binary data layout. There is also the fact that certain aspects of the serialization code has changed and become more reliable in Odin 2.0. We will very likely be submitting 2.0 to the Asset Store tomorrow, and you can try it out then to see whether the issue is fixed there. I can also send you an RC build faster than that, if you mail me your Odin invoice ID at tor@sirenix.net.

    If it is not fixed in 2.0, I will create a diagnostic build that does a lot of extra logging during deserialization and send it to you for testing, and we can work from that point.

  4. Joel Clark

    We haven't had an opportunity to update & check. We started seeing a separate issue within Unity that blocked us from testing this one. We've just cleared that one up, though, and we'll be able to try it out against 2.0 this week.

  5. Log in to comment