Unity Editor crashes when I am trying to load ScriptableObjects

Unity Editor crashes when I am trying to load ScriptableObjects and Textures, that SO’s contains. It’s crashing when I load all SO’s in one place, or when I am trying to do smth in my game, not even with SO’s. It works fine on device, I tried Android and OSX bundles to load – the same issue. My Textures are in SpriteAtlas, and when I load them from ScriptableObject’s everything is just fine, but it always crashes in editor.
Crash log in Mac report: Unity Crash Thread 0 Crashed:: Main Thread Dispatch queue
Unity version: 2019.3.12.f1
MacOS version: 10.14.5

1 Like

Hi @NGameDeveloper ,

Maybe you can check the Unity Editor log files for more information about the crashes.

You can find more information about them here: Unity - Manual: Log files

Good luck with it!

Thank you for the response. Here is the log of this error, but I still don’t see what could cause it. Maybe, you will tell me what I am missing here?

Dereferencing NULL PPtr!
UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal_Injected(RenderTexture, Int32, Vector2&, Boolean, Boolean)
UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal(RenderTexture, Int32, Vector2, Boolean, Boolean)
UnityEditor.PlayModeView:RenderView(Vector2, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/PlayModeView/PlayModeView.cs:170)
UnityEditor.GameView:OnGUI() (at /Users/builduser/buildslave/unity/build/Editor/Mono/GameView/GameView.cs:832)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.HostView:Invoke(String, Object) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:381)
UnityEditor.HostView:Invoke(String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:375)
UnityEditor.HostView:InvokeOnGUI(Rect, Rect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:345)
UnityEditor.DockArea:smile:rawView(Rect, Rect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:401)
UnityEditor.DockArea:OldOnGUI() (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:390)
UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:276)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect, Action, Boolean) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:508)
UnityEngine.UIElements.IMGUIContainer:smile:oIMGUIRepaint() (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:463)
UnityEngine.UIElements.UIR.RenderChainCommand:ExecuteNonDrawMesh(DrawParams, Boolean, Single, Exception&) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderers.cs:107)
UnityEngine.UIElements.UIR.UIRenderDevice:EvaluateChain(RenderChainCommand, Rect, Matrix4x4, PanelClearFlags, Texture, Texture, Texture, Single, NativeArray`1, NativeArray`1, Exception&) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:849)
UnityEngine.UIElements.UIR.UIRenderDevice:smile:rawChain(RenderChainCommand, Rect, Matrix4x4, PanelClearFlags, Texture, Texture, Texture, Single, NativeArray`1, NativeArray`1, Exception&) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:959)
UnityEngine.UIElements.UIR.RenderChain:Render(Rect, Matrix4x4, PanelClearFlags) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRChainBuilder.cs:380)
UnityEngine.UIElements.UIRRepaintUpdater:smile:rawChain(Rect, Matrix4x4) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:68)
UnityEngine.UIElements.UIRRepaintUpdater:Update() (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:57)
UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase(VisualTreeUpdatePhase) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/VisualTreeUpdater.cs:84)
UnityEngine.UIElements.Panel:UpdateForRepaint() (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:712)
UnityEngine.UIElements.Panel:Repaint(Event) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:738)
UnityEngine.UIElements.UIElementsUtility:smile:oDispatch(BaseVisualElementPanel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.bindings.cs:387)
UnityEngine.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.bindings.cs:194)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

[/Users/builduser/buildslave/unity/build/Runtime/BaseClasses/PPtr.h line 291]
(Filename: /Users/builduser/buildslave/unity/build/Editor/Mono/PlayModeView/PlayModeView.cs Line: 170)

Obtained 14 stack frames.
#0  0x00000108903dea in RecalculateUVs(StrideIterator<Vector2f>, StrideIterator<Vector2f>, StrideIterator<Vector3f>, Texture2D&, Vector2f const&, RectT<float> const&, Vector4f const&, RectT<float> const&, Vector2f const&, SpritePackingRotation, float)
#1  0x00000108215bc5 in PrepareSpriteTilingData(SharedMeshData*, Vector2f, SpriteDrawMode, bool, float, Sprite const*, SpriteTilingJobData&)
#2  0x00000108a0bd59 in SpriteRenderer::ScheduleSpriteTilingJobIfNeeded()
#3  0x00000108a09a84 in SpriteRenderer::RendererCullingOutputReady(BaseRenderer**, unsigned long, RendererCullingCallbackProperties const&)
#4  0x0000010840d94c in DispatchGeometryJobs(dynamic_array<BaseRenderer*, 0ul>*, RendererCullingCallbackProperties const&)
#5  0x000001083ce24a in Camera::CustomRender(CullResults&, ShaderPassContext&, CameraRenderingParams const*, Camera::RenderFlag, Camera::PerformRenderFunction*, void (*)(), void (*)())
#6  0x000001083e7fcf in RenderManager::RenderCameras(int, void (*)(), void (*)())
#7  0x00000106794af5 in RepaintController::RenderPlayModeViewCameras(RenderTexture*, int, Vector2f, bool, bool)
#8  0x0000010737175c in EditorGUIUtility::RenderPlayModeViewCamerasInternal(RenderTexture*, int, Vector2f, bool, bool)
#9  0x00000107f2e1df in EditorGUIUtility_CUSTOM_RenderPlayModeViewCamerasInternal_Injected(ScriptingBackendNativeObjectPtrOpaque*, int, Vector2f const&, unsigned char, unsigned char)
#10 0x0000015badca1d in  (wrapper managed-to-native) UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal_Injected (UnityEngine.RenderTexture,int,UnityEngine.Vector2&,bool,bool) {0x7faf10f3b858} + 0xbd (0x15badc960 0x15badcadd) [0x14d650c80 - Unity Child Domain]
#11 0x007faf0cf491f0 in (Unknown)
#12 0x007ffee9f24df0 in (Unknown)
#13 0x007ffee9f25870 in (Unknown)
Launching bug reporter
[Unity Package Manager (Upm)]
Parent process [2630] was terminated
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QObject(0x7ffcc3a1e760), parent's thread is QThread(0x7ffcc38011f0), current thread is Thread(0x7ffcc6e1be20)

Thank you for the log. It’s also not clear to me what’s the root of the issue yet.

Can you try to reproduce the issue on an almost empty project, where you load a texture from one of your ScriptableObjects?

Thank you for your recommendations, Diego. I can’t reproduce this crash in the empty project - it’s not appearing, but I noticed it also does not appear in the editor when I turn off most of the objects that use my ScriptableObjects. I think that something could be overloaded when I’m doing this, but still don’t get what exactly. The problem should be related to this AssetBundle and ScriptableObjects, because my project has never crashed like this before. Sorry for such an abstract problem description, feel free to can ask for any details. In general, it is a Scene reskiner using remote AssetBundle.

In that case, my recommendation is to try to isolate the problem as much as you can in order to find which AssetBundle, ScriptableObject, or which specific situation is causing the crash.

You mentioned that the issue is not happening when you’re turning off most of the objects using your ScriptableObjects… How about starting from there, and then turning on one by one until you find the crash?

Good luck with it!

1 Like