#[BUG] Editor crashing without crash handler during loading of subscene during domain reload

1 messages · Page 1 of 1 (latest)

tulip grail
#

Whenever there are multiple subscenes opened in active scene, doing domain reload (script change) causes a crash. One by one or no subscenes at all does not cause crash.

Reproduces in: 1.2.3, 1.3.0-exp.1, 1.3.0-pre.4
Editors tested: 2022.3.36f, 2022.3.38f

Editor log ends up with hundreds of

Assertion failed on expression: 'CurrentThreadIsMainThread()'
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.Resources:InstanceIDToObjectList (Unity.Collections.NativeArray`1<int>,System.Collections.Generic.List`1<UnityEngine.Object>)
Unity.Entities.Serialization.ManagedObjectBinaryReader:.ctor (Unity.Collections.LowLevel.Unsafe.UnsafeAppendBuffer/Reader*,Unity.Collections.NativeArray`1<int>) (at Packages/com.unity.entities@1.3.0-pre.4/Unity.Entities/Serialization/ManagedObjectBinarySerialization.cs:205)

And finishes with exceptions sent in attachment.

This is extremely frustrating as it fully blocks from any work on project.

@gilded tundra

#

I think I found temporary workaround which fixes crashes (but need further testing).

Replaced InstanceIDToObjectList with manual iteration and calling InstanceIDTOObject foreach.

        public ManagedObjectBinaryReader(UnsafeAppendBuffer.Reader* stream, NativeArray<int> unityObjects)
        {
            m_Stream = stream;
            m_Params = new BinarySerializationParameters
            {
                UserDefinedAdapters = new List<IBinaryAdapter> { this },
                State = new BinarySerializationState(),
            };
            m_UnityObjects = unityObjects;
            m_UnityObjectsArray = new List<UnityEngine.Object>(m_UnityObjects.Length);

            foreach (var unityObject in unityObjects)
            {
                var obj = Resources.InstanceIDToObject(unityObject);
                m_UnityObjectsArray.Add(obj);
            }

            // Resources.InstanceIDToObjectList(unityObjects, m_UnityObjectsArray);
        }
tulip grail
tulip grail
#

So something I found out - clone of exact same repository, but in different location on disk does not crash.

gilded tundra
#

people really seem to think this was fixed on the editor side sometime last fall, and that that assert should be gone in editors since then. how sure are you that you're running with those editor versions?

tulip grail
tulip grail
#

@gilded tundra recently almost our whole team started crashing. To clarify detail I noticed: crashing only happens in edit mode. In play mode - no crashing.
This is really hurting our progress, so really hoping on something.

wispy river
#

Hmm I've never crashed from this in your project, are all the people crashing using macs @tulip grail ?

wispy river
#

Well there goes my theory

tulip grail
#

Macs crash too

gilded tundra