Search Unity

Official Burst + Xcode 13.3 builds for iOS/iPadOS/tvOS and IL2CPP + macOS

Discussion in 'Burst' started by sheredom, Apr 20, 2022.

  1. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    TL;DR - we've become aware of an issue when using Burst with Xcode 13.3 or newer to build for iOS/iPadOS/tvOS or using IL2CPP with macOS. The bug isn't exactly a Burst issue, but what we believe to be a general Clang bug that we've uncovered affecting LLVM versions 12+, which manifests as a miscompilation of the Hash128 constructor as produced through IL2CPP, which causes issues in Burst with SharedStatic. To fix/workaround this, we're going to have to land a fix for the Hash128 constructor to the 2022.1, 2021.3, and 2020.3 editors.

    In the meantime we advise holding on the 13.2.1 release of Xcode when doing iOS/iPadOS/tvOS and IL2CPP with macOS builds with Burst.

    The reason this issue manifests in Burst is when using SharedStatic's. For those that do not know, SharedStatic's use a Hash128 to create a hash of the types to GetOrCreate so that each SharedStatic gets a unique location in memory backing it. Burst and managed both have to generate the same hash for the same types to ensure they both access the same memory location, and we observed with Xcode 13.3 and newer that half of the hash was being incorrectly generated in the Hash128 constructor that was being produced via IL2CPP and compiled with Xcode's Clang. This meant that Burst was accessing what it thought was a previously created SharedStatic, but since the managed side (IL2CPP) had used an incorrect hash, Burst was doing a null pointer dereference. Since SharedStatic's are used so heavily in DOTS code (EG. the TypeManager in Entities), users using DOTS will be affected by the issue.
     
  2. Gunther-Fox

    Gunther-Fox

    Joined:
    Jul 14, 2015
    Posts:
    1
    Hello @sheredom ! Is there any update on this or any bug tracking tickets we can follow? We have some folks whose iOS devices have been updated to an extent where they can no longer build without upgrading Xcode to 13.3
     
  3. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    The PRs to Unity are landed my end, just waiting for them to go through the processes and go out as new editor patch versions.
     
  4. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    The first editor with the fix is public - 2021.3.2 https://unity3d.com/unity/whats-new/2021.3.2

    IL2CPP: Workaround the Clang 12+ bug that could surface with IL2CPP by changing the Hash128 constructor code. (1422065)​
     
    cristian_aug likes this.
  5. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    The next editor with the fix is public - 2022.1.1 https://unity3d.com/unity/whats-new/2022.1.1

    IL2CPP: Workaround the Clang 12+ bug that could surface with IL2CPP by changing the Hash128 constructor code. (1422065)​
     
    cristian_aug likes this.
  6. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    The last editor with the fix is public - 2020.3.35 https://unity3d.com/unity/whats-new/2020.3.35

    IL2CPP: Workaround the Clang 12+ bug that could surface with IL2CPP by changing the Hash128 constructor code. (1422065)
    This concludes the period where we advised you to hold on 13.2.1, and users should now be free to track the latest Xcode release.
     
    cristian_aug likes this.
  7. demiurge180

    demiurge180

    Joined:
    Apr 29, 2020
    Posts:
    21
    @sheredom I know this is a long shot but is there any chance at all that this issue or similar has persisted into 13.4.1, only for macOS builds but regardless of the scripting backend? For whatever reason Unity 2020.3 and 2021.3 just cannot get Burst to work for that.
     
    burakkurkcu likes this.
  8. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    I've not seen this issue since I added the workarounds above. If you can submit a bug with a repro we can always take a look.
     
  9. demiurge180

    demiurge180

    Joined:
    Apr 29, 2020
    Posts:
    21
    Last edited: Aug 18, 2022