Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Occasional Freezing During LoadAsset or Rendering on iOS Devices: Seeking Help with Stack Traces

Discussion in 'Addressables' started by untory1, Apr 14, 2023.

  1. untory1

    untory1

    Joined:
    Apr 14, 2023
    Posts:
    4
    My game occasionally (with a very low probability) freezes during LoadAsset or rendering, and most of the time it happens on iOS devices. Below are the main thread and rendering thread stack traces when the game freezes.

    Main Thread
    Code (CSharp):
    1. UnityFramework 0x0000000109bb465c Baselib_SystemSemaphore_Acquire (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
    2. UnityFramework 0x0000000109262718 CreateGpuProgram (Baselib_Semaphore_SemaphoreBased.inl.h:0)
    3. UnityFramework 0x0000000109505ebc Compile (ShaderProgram.cpp:0)
    4. UnityFramework 0x0000000109506d1c EnsureCompiledAndMarkUnsupportedIfFailed (ShaderProgram.h:228)
    5. UnityFramework 0x0000000109506f8c GetMatchingSubProgram (ShaderProgram.cpp:988)
    6. UnityFramework 0x000000010950bf28 FindSubProgramsToUse (ShaderState.cpp:428)
    7. UnityFramework 0x000000010950c200 ApplyShaderState (ShaderState.cpp:552)
    8. UnityFramework 0x0000000109504c20 ApplyPass (ShaderPass.cpp:0)
    9. UnityFramework 0x00000001094c111c ApplyMaterialPassWithCache (MaterialDisplayListCache.cpp:204)
    10. UnityFramework 0x00000001094c11c8 ApplyMaterialPassAndKeywordsWithCache (ApplyKeywords.h:29)
    11. UnityFramework 0x00000001094624e4 ApplyShaderPass (ScriptableBatchRenderer.cpp:1392)
    12. UnityFramework 0x000000010946e490 ScriptableRenderLoopDrawSRPBatcher (ScriptableDrawRenderers.cpp:281)
    13. UnityFramework 0x000000010946fb44 ScriptableRenderLoopDrawDispatch (ScriptableDrawRenderers.cpp:670)
    14. UnityFramework 0x0000000109471d88 ScriptableRenderLoopJob (ScriptableDrawRenderers.cpp:0)
    15. UnityFramework 0x00000001095a2378 ExecuteAsync (GfxDevice.cpp:2244)
    16. UnityFramework 0x0000000109470b04 ScheduleRenderJobs (ScriptableDrawRenderers.cpp:1155)
    17. UnityFramework 0x0000000109470928 ExecuteDrawRenderersCommand (ScriptableDrawRenderers.cpp:1228)
    18. UnityFramework 0x0000000109468220 ExecuteScriptableRenderLoop (ScriptableRenderContext.cpp:0)
    19. UnityFramework 0x000000010ca531a8 DataDrivenRenderPipeline_Render_m7EE1522A33AD2F0AF0E05AC3712E84946C77446F (RenderFrameAssembly.cpp:7635)
    20. UnityFramework 0x000000010d05d75c RenderPipelineManager_DoRenderLoop_Internal_mC7284469EE225EDE34412BA1DC73C63AD3BE8EC9 (UnityEngine.CoreModule4.cpp:42396)
    21. UnityFramework 0x0000000108d1379c RuntimeInvoker_FalseVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5_RuntimeObject_IntPtr_t_RuntimeObject (Il2CppInvokerTable.cpp:154640)
    22. UnityFramework 0x0000000109ff2820 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 116
    23. UnityFramework 0x00000001095bb718 scripting_method_invoke (ScriptingApi_Il2Cpp.cpp:292)
    24. UnityFramework 0x00000001095bfe88 Invoke (ScriptingInvocation.cpp:273)
    25. UnityFramework 0x000000010946908c ExtractAndExecuteRenderPipeline (ScriptableRenderContext.cpp:1506)
    26. UnityFramework 0x0000000109348c44 RenderCamerasWithScriptableRenderLoop (RendererScene.cpp:588)
    27. UnityFramework 0x0000000109348d2c RenderCameras (RenderManager.cpp:282)
    28. UnityFramework 0x00000001094a5ee4 PlayerRender (Player.cpp:1050)
    29. UnityFramework 0x00000001094a0f88 ExecutePlayerLoop (PlayerLoop.cpp:0)
    30. UnityFramework 0x00000001094a0fc8 ExecutePlayerLoop (PlayerLoop.cpp:408)
    31. UnityFramework 0x00000001094a1294 PlayerLoop (PlayerLoop.cpp:515)
    32. UnityFramework 0x0000000109a8e0cc UnityPlayerLoopImpl (LibEntryPoint.mm:687)
    33. UnityFramework 0x000000010894f338 -[UnityAppController(Rendering) repaint] (UnityAppController+Rendering.mm:233)
    34. UnityFramework 0x000000010894f2a0 -[UnityAppController(Rendering) repaintDisplayLink] (UnityAppController+Rendering.mm:72)
    Thread # 29UnityGfxDeviceWorker
    Code (CSharp):
    1. libsystem_kernel.dylib 0x00000001b7e40c40 0x00000001b7e3d000 + 15416
    2. libdispatch.dylib 0x00000001b7d1e514 0x00000001b7d1b000 + 13588
    3. libdispatch.dylib 0x00000001b7d1eb8c 0x00000001b7d1b000 + 15244
    4. UnityFramework 0x0000000109bb465c Baselib_SystemSemaphore_Acquire (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
    5. UnityFramework 0x00000001093ec00c AsyncResourceUploadBlocking (Baselib_CappedSemaphore_SemaphoreBased.inl.h:0)
    6. UnityFramework 0x00000001095a1fe8 SyncAsyncResourceUpload (GfxDevice.cpp:0)
    7. UnityFramework 0x00000001099e7d38 RunCommand (GfxDeviceWorker.cpp:0)
    8. UnityFramework 0x0000000109a565d0 GfxDeviceWorkerAutoreleasePoolProxy (GfxDeviceMetal.mm:5320)
    9. UnityFramework 0x00000001099eb7c8 RunExt (GfxDeviceWorker.cpp:389)
    10. UnityFramework 0x00000001099e36dc RunGfxDeviceWorker (GfxDeviceWorker.cpp:353)
    11. UnityFramework 0x0000000109542b40 RunThreadWrapper (Thread.cpp:81)
    12. libsystem_pthread.dylib 0x00000001b7d81840 0x00000001b7d80000 + 6040
     
  2. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    354
  3. untory1

    untory1

    Joined:
    Apr 14, 2023
    Posts:
    4
  4. untory1

    untory1

    Joined:
    Apr 14, 2023
    Posts:
    4
    Last edited: Apr 18, 2023
  5. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    354
    I can only reproduce this issue in our project, not in a minimal project. That project "AUPFreeze2.zip" is not a reproducible project. I just submitted it along with my investigation and workaround. The workaround needs to modify the source code of engine side, so it dosen't fit everyone. I asked Unity Support about the progress of this issue yesterday, but they havn't responded yet.