Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Unity 5.3.5 YAML String Corruption

Discussion in 'Editor & General Support' started by AlkisFortuneFish, Jun 15, 2016.

  1. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Hi all,

    We've been having a very odd intermittent issue here, where very occasionally Unity will serialize all managed strings to YAML as hex strings, corrupting basically anything that is currently marked dirty.

    Strings in scenes, prefabs, animators, etc. are all lost and replaced with a hex string, then deserialized as a string causing merry hell.

    We have been unable to find any sort of reproduction steps, this happened 4 times over two weeks, on totally different machines used by different people with different workflows.

    The latest two times it has been on 5.3.5p2 but I'm sure that the first two it was on f1.

    Here are a few example diffs as to what happens:

    Code (csharp):
    1.  
    2. -          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
    3. +          m_ObjectArgumentAssemblyTypeName: 556e697479456e67696e652e4f626a6563742c20556e697479456e67696e65
    4. -  SingleStateName: Sway
    5. +  SingleStateName: 53776179
    6. -  SFXBaseString: event:/SFX/Environment/
    7. -  SFXName: Rustle
    8. +  SFXBaseString: 6576656e743a2f5346582f456e7669726f6e6d656e742f
    9. +  SFXName: 527573746c65
    10.  
    For example, 527573746c65 is just the ASCII representation of Rustle, so something has obviously been serialised as the wrong type!

    When this happens, Unity will *always* crash on exit, which implies potential heap corruption.

    I'm not sure how to even go on to report this as a bug that won't end up at the bottom of every bug pile, considering the lack of any sort of possible repro project or steps.

    Has anyone ever come across anything similar?
     
    Last edited: Jun 15, 2016
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    It has happened again today, different machine, different person, different components. Uploaded an example.
     

    Attached Files:

  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    We may be getting closer to getting a repro for this. It seems potentially related to 800920. Under certain circumstances, Unity seems to retain a lock to Assembly-CSharp.dll, if the assembly has failed to compile and the error is then corrected.

    It then brings up an error that it is unable to move the dll from temp to ScriptAssemblies, the same one that occurs if your antivirus is holding the DLL open only the owner of the file handle is Unity.exe. If at that point the scene is dirty, any components reserialized lose all their strings.

    I have been unable to reproduce this on another project yet, but I'll get to the bottom of it. What's confusing is that even though this repro always reproduces it, it has definitely happened without that workflow or error coming up.
     
  4. juyanith

    juyanith

    Joined:
    Jan 22, 2015
    Posts:
    8
    I don't have anything to add in terms of reproducing this error, but I can confirm that we have the same issue. It can be devastating as the corrupted data can easily be pushed out to other teammates and, depending on what exactly was corrupted, can be mild or completely kill the project.
     
  5. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    I never managed to get down to a solid repro but it seems to have stopped happening after the patches that fixed 800920.