Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug 2021.3.5-9f1 iOS deadlock in garbage collector

Discussion in 'Editor & General Support' started by allenbling, Oct 14, 2022.

  1. allenbling


    Dec 2, 2021
    I've been chasing this for a week now without any luck. Somewhat uncommonly (maybe 3% of the time), my app deadlocks in iOS. It gets stuck waiting for the garbage collector to run. The screen freezes completely, but the OS won't kill it until it's put in the background. The crash logs always have the following (see attached) stack trace in thread 1, and then there is a thread running a finalizer which has a stack trace that varies by crash. This occurs right after a call to SceneManager.LoadScene. I can see from logs that the scene loads, Awakes are run, and then the app freezes before any OnEnables or Starts run.

    I've tried:
    Unity versions 2021.3.5f1 through 2021.3.9f1
    Xcode versions 13.2.0, 13.3.1, 13.4.0
    Devices tested: iPhone XR (ios 15.3.1), iPad 7th generation (15.4.1), iPhone 13 Pro Max (16.0)

    Other info:
    Incremental GC: No
    Api Comptability level: .NET Standard 2.1
    Managed Stripping Level: Minimal
    Preloaded assets: None

    Any ideas on how to debug this?

    Screen Shot 2022-10-14 at 10.47.43 AM.png Screen Shot 2022-10-14 at 10.50.41 AM.png Screen Shot 2022-10-14 at 10.39.58 AM.png
    Qd_ likes this.