Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Crash in shader that triggers from addressable

Discussion in 'Addressables' started by PlaycorpStudios, Nov 25, 2020.

  1. PlaycorpStudios

    PlaycorpStudios

    Joined:
    Aug 2, 2016
    Posts:
    48
    Hi guys,

    We occasionally getting this crash in the build that triggers from Addressable.Release. We would appreicate if you guys can help us on this matter.

    0x00007FFFF2F3B95F (UnityPlayer) Shader::FixupSubshaderAndPassIndices
    0x00007FFFF2482CD1 (UnityPlayer) ShaderLab::pass::ApplyPass
    0x00007FFFF246ACA1 (UnityPlayer) ApplyMaterialPassWithCache
    0x00007FFFF246A8DD (UnityPlayer) ApplyMaterialPassAndKeywordsWithCache
    0x00007FFFF1E4ACBB (UnityPlayer) BatchRenderer::ApplyShaderPass
    0x00007FFFF1E4EFE9 (UnityPlayer) ForwardRenderLoopJob
    0x00007FFFF1C6ABC5 (UnityPlayer) ExecuteAsyncSetup
    0x00007FFFF22E0A49 (UnityPlayer) JobQueue::Exec
    0x00007FFFF22E76EA (UnityPlayer) JobQueue::WaitForJobGroupID

    Regards,
    Emad
     

    Attached Files:

  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
  3. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Some of my players are getting the same problem.

    I don't have steps to reproduce so I can't submit a bug report. Some players get it at some point after playing the game for a while. Not all players experience those.

    Error message was : EXCEPTION_ACCESS_VIOLATION_READ

    This is what I got out of backtrace:

    Code (CSharp):
    1. [ 00 ] public: Shader::FixupSubshaderAndPassIndices(int &,int &)const
    2. [ 01 ] public: ShaderLab::Pass::ApplyPass(unsigned int,class ShaderPropertySheet const *,struct ShaderPassContext &,class Shader *,int,int,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    3. [ 02 ] ApplyMaterialPassWithCache(struct SharedMaterialData const &,struct ShaderPassContext &,class Shader *,class ShaderLab::Pass *,int,int,bool,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    4. [ 03 ] ApplyMaterialPassAndKeywordsWithCache(struct SharedMaterialData const &,struct ShaderPassContext &,class Shader *,class ShaderLab::Pass *,int,int,bool,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    5. [ 04 ] public: BatchRenderer::ApplyShaderPass(struct ShaderPassContext &,struct SharedMaterialData const *,class Shader *,struct BatchRenderer::PassInfo &,enum BatchingFlags,bool,bool,class ShaderLab::GrabPasses const *,struct DeviceRenderStateBlock const *)
    6. [ 05 ] ForwardRenderLoopJob
    7. [ 06 ] ExecuteAsyncSetup
    8. [ 07 ] private: JobQueue::Exec(struct JobInfo *,__int64,int)
    9. [ 08 ] public: JobQueue::WaitForJobGroupID(struct JobGroupID,enum JobQueue::JobQueueWorkStealMode)
    10. [ 09 ] CompleteFenceInternal(struct JobFence &,enum WorkStealMode)
    11. [ 10 ] public: virtual GfxDevice::EndAsyncJobFrame(void)
    12. [ 11 ] public: virtual GfxDeviceClient::DeleteTexture(struct TextureID)
    13. [ 12 ] protected: Texture2D::DeleteGfxTexture(void)
    14. [ 13 ] public: virtual Texture2D::MainThreadCleanup(void)
    15. [ 14 ] delete_object_internal_step1(class Object *)
    16. [ 15 ] delete_object_internal(class Object *)
    17. [ 16 ] DestroyAllAtPath
    18. [ 17 ] UnloadAssetBundle(class AssetBundle &,bool,bool)
    19. [ 18 ] AssetBundle_CUSTOM_Unload(class ScriptingBackendNativeObjectPtrOpaque *,unsigned char)
    20. [ 19 ] 0x7ffb22839088
    21. [ 20 ] 0x7ffb216a38c7
    22. [ 21 ] 0x7ffb2246b67b
    23. [ 22 ] 0x7ffb22aaf56d
    24. [ 23 ] RectTransformUtility_CUSTOM_PointInRectangle_Injected(class Vector2f const &,class ScriptingBackendNativeObjectPtrOpaque *,class ScriptingBackendNativeObjectPtrOpaque *,class Vector4f const &)
    25. [ 24 ] 0x7ffb230db862
    26. [ 25 ] 0x7ffb215f5eb8
    27. [ 26 ] 0x7ffb22410dd7
    28. [ 27 ] 0x7ffb2283e756
    29. [ 28 ] 0x7ffb22aaf56d
    30. [ 29 ] 0x7ffb2291449f
    31. [ 30 ] 0x7ffb229147e9
    32. [ 31 ] scripting_class_get_parent(class ScriptingClassPtr)
    33. [ 32 ] 0x7ffb2283acad
    34. [ 33 ] RtlFreeHeap
    35. [ 34 ] 0x2ec9bf870c0
    36. [ 35 ] 0x7ffb2245e60f
    37. [ 36 ] 0x7ffb2246b6a5
    38. [ 37 ] 0x7ffb22aaf56d
    39. [ 38 ] 0x7ffb2291449f
    40. [ 39 ] 0x7ffb229147e9
    41. [ 40 ] 0x7ffb35236c34
    42. [ 41 ] 0x7ffb2283aa60
    43. [ 42 ] 0x7ffb22d2d98c
    44. [ 43 ] 0x7ffb2245f215
    45. [ 44 ] 0x7ffb2283f5f3
    46. [ 45 ] 0x7ffb22464680
    47. [ 46 ] 0x7ffb22aaf56d
    48. [ 47 ] 0x7ffb2291449f
    49. [ 48 ] free_alloc_internal(void *,struct MemLabelId,char const *,int)
    50. [ 49 ] public: ICallString::ToUTF8(void)const
    51. [ 50 ] 0x7ffb22d2d76c
    52. [ 51 ] free_alloc_internal(void *,struct MemLabelId,char const *,int)
    53. [ 52 ] 0x7ffb22845807
    54. [ 53 ] 0x7ffb21dada7d
    55. [ 54 ] 0x7ffb35e08e40
    56. [ 55 ] 0x7ffb2291449f
    57. [ 56 ] 0x7ffb2326d86b
    58. [ 57 ] GameObject_Get_Custom_PropActive(class ScriptingBackendNativeObjectPtrOpaque *)
    59. [ 58 ] 0x7ffb222f8df7
    60. [ 59 ] 0x7ffb224f39f1
    61. [ 60 ] 0x7ffb7e01a04f
    62. [ 61 ] 0x7ffb7e01992a
    63. [ 62 ] 0x7ffb21dfc645
    64. [ 63 ] 0x7ffb21c1c343
    65. [ 64 ] 0x7ffb217dc02c
    66. [ 65 ] 0x7ffb216d4519
    67. [ 66 ] scripting_method_invoke(class ScriptingMethodPtr,class ScriptingObjectPtr,struct ScriptingArguments &,class ScriptingExceptionPtr *,bool)
    68. [ 67 ] public: ScriptingInvocation::Invoke(class ScriptingExceptionPtr *,bool)
    69. [ 68 ] private: MonoBehaviour::CallMethodIfAvailable(int)
    70. [ 69 ] private: MonoBehaviour::CallUpdateMethod(int)
    71. [ 70 ] protected: BaseBehaviourManager::CommonUpdate<class BehaviourManager>(void)
    72. [ 71 ] ExecutePlayerLoop(struct NativePlayerLoopSystem *)
    73. [ 72 ] ExecutePlayerLoop(struct NativePlayerLoopSystem *)
    74. [ 73 ] PlayerLoop(void)
    75. [ 74 ] PerformMainLoop
    76. [ 75 ] MainMessageLoop
    77. [ 76 ] UnityMainImpl(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int)
    78. [ 77 ] UnityMain
    79. [ 78 ] __scrt_common_main_seh
    80. [ 79 ] BaseThreadInitThunk
    81. [ 80 ] RtlUserThreadStart
    So seems to be related to deleting a texture when unloading an asset bundle (addressables0
     
  4. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Let me flag for the team to have a look.
     
  5. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382

    Seems to have been happening quite a bit to at least one of the players in my beta. Might be happening more since I last updated addressables/unity but can't really tell since it seems to be fairly random.
     
  6. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    Hey all, sorry for the trouble you're having. While Addressables may be the system that hits that bug I don't think Addressables is what's causing the crash. Since you're both hitting the crash on Shader::FixupSubshaderAndPassIndices I think we're just so happens hitting a bug in their system.

    If you haven't done so please file a bug for this if you're able. The QA team there should make sure this gets to the correct team (even if it does turn out to be us).

    I'll give it a shot and see if I can reproduce it. If it is a Shader team problem you might try upgrading your version of Unity to see if the problem has been resolved.
     
  7. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I can try filing the bug report. However it seems that only certain players can trigger the crash. A player that can trigger the crash fairly frequently sent us a save and said:

    "This save is consistently crashing within 2-3 minutes of loading. entering a store menu or chest might increase the odds of a crash. turning settings to low and turning off most of the options had no effect."

    However other players using the same save to test didn't get the crash not even once.

    Will still try though.

    My Unity is updated to the latest LTP release, 2019.4.16f1
     
  8. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    After turning off "Graphics Jobs" those crashes went away.
     
  9. Shii

    Shii

    Joined:
    Nov 23, 2014
    Posts:
    31
    Having same crash issue in Unity 2019.4.24f1. Happens sometimes when trying to unload asset bundle with command 'Unload(true)' then starting coroutine and in coroutine body calling 'yield return null' or 'yield return new WaitForEndOfFrame()' Any updates on this issue?
    upload_2021-4-10_20-14-55.png
     
    Last edited: Apr 10, 2021
  10. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Hey @Shii, as we recommended for the others, please submit a bug report for us. :)
     
  11. wey

    wey

    Joined:
    Oct 22, 2015
    Posts:
    5
    Having same crash issue in Unity 2019.4.22f1
     
  12. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Please kick us a bug report. :)