Search Unity

Bug DownloadHandlerTexture Crash on Unity 2021.3

Discussion in 'Editor & General Support' started by SanteEtermax, Mar 15, 2023.

  1. SanteEtermax

    SanteEtermax

    Joined:
    Feb 2, 2023
    Posts:
    10
    Hi! We are migrating from Unity 2020.3.34 to 2021.3.17 and just released our game last week to check for possible crash/ANRs problems.

    We checked Firebase Crashlytics and found a repetitive crash with title "DownloadHandlerTexture::OnFinishReceiveData()" in iOS and Android. iOS also says EXC_BAD_ACCESS (KERN_INVALID_ADDRESS) and on Android says SIGSEGV.

    I don't know for sure, but it seems a access violation to memory and I think it's being caused by a memory leak. Every user we checked on "Data" section demonstrates they had very low memory. Usually between 40 MB - 100 MB.

    Here's an example:



    The stacktrace doesn't seem to have much to say. The vast majority look all the same.

    Here's an example of iOS:



    Here's an example of Android:



    Very important notes to take into account:

    • We didn't change anything in our code when we migrated to Unity 2021.3.17. We did the absolutely minimum changes needed for it to work on this LTS Release to reduce the number of suspects of possible problems.
    • We never had this problem in iOS. In fact, we released another build made with Unity 2020.3.34, branching from a point previous to migration, and crashes went down again. No signs of this error.
    • In Android we really don't know for sure as we started to upload symbols to Crashlytics lately.
    • We had a lot of crash events in iOS. Exactly "572 crash events affecting 117 users" (Our game doesn't have much total users). In previous iOS builds (made with Unity 2020.3.34) crash events appeared sporadically.
    • We currently can't reproduce this error in our devices.
    • We use XCode 13.2
    • We have only 1 scene (I know it's bad, it's an old project). I clarify this because I know DownloadHandlerTexture can have problems when an scene is being loaded. This error happens long after the main scene was loaded.
    • We don't call Resources.UnloadUnusedAssets anywhere in our code.
    • Almost every user that had this problem didn't stay in the app for long, as the app crashes when they barely pass the login view.
    • We use Addressables.

    Please, if there's any information wrong or that could help and I didn't provide, let me know. This is very critical for us right now, therefore I'll keep my eyes on this thread.

    Thank you in advance!
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    I believe this bug is fixed in 2021.3.21f1 (not sure if it's even out yet, the fix landed very recently).
     
    Thomas-Mountainborn likes this.
  3. SanteEtermax

    SanteEtermax

    Joined:
    Feb 2, 2023
    Posts:
    10
    Thank you for the quick reply.

    Indeed we just found this issue in your issue tracker and it says it's fixed in Unity 2021.3.21. We don't know if it is the same issue, but we'll test it out and I'll return with the news.

    Thank you again!
     
    Thomas-Mountainborn likes this.
  4. SanteEtermax

    SanteEtermax

    Joined:
    Feb 2, 2023
    Posts:
    10
    I'm back with news. Unity 2021.3.21, indeed, solved this issue. Thank you so much again!

    Unfortunately a new crash appeared in this new version, but this time has a lower impact. It only happens in Android and we have much fewer events.

    Still, i've created this thread about said crash. Any help would be appreciated!

    Thank you again!
     
    Thomas-Mountainborn likes this.