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. Dismiss Notice

iOS Native Crash on UnityUseAnimatedAutorotation (TrampolineGlue)

Discussion in 'iOS and tvOS' started by JSC-Sparkling, Sep 14, 2020.

  1. JSC-Sparkling

    JSC-Sparkling

    Joined:
    Sep 27, 2019
    Posts:
    4
    Hi, we're encountering a bunch of native crashes on iOS related to
    UnityUseAnimatedAutorotation
    when using 2019.4.9f1.

    From what I can gather (based on the stacktrace below), the Trempoline is being cleaned-up on stack frame 31, and being accessed again on stack frame 0, which would probably lead to exceptions since I'd mostly a bad idea to access an object after it's cleaned-up.

    Is anyone else having this issue, or is there a known solution/work-around for this?

    Stacktrace (taken from the Unity Crashes & Exceptions page):
    Code (csharp):
    1. Thread 0 (crashed)
    2. 0   UnityFramework                     0x0000000106a52f34 UnityUseAnimatedAutorotation (TrampolineGlue.mm:46)
    3. 1   UnityFramework                     0x000000010601e834 -[UnityViewControllerBase(iOS) viewWillTransitionToSize:withTransitionCoordinator:] (UnityViewControllerBase+iOS.mm:90)
    4. 2   UIKitCore                          0x00000001ac84f22c <system symbols missing>
    5. 3   UIKitCore                          0x00000001ac864f7c <system symbols missing>
    6. 4   UIKitCore                          0x00000001acec4ac0 <system symbols missing>
    7. 5   UIKitCore                          0x00000001acec4814 <system symbols missing>
    8. 6   UIKitCore                          0x00000001aced0b5c <system symbols missing>
    9. 7   UIKitCore                          0x00000001acec69c8 <system symbols missing>
    10. 8   UIKitCore                          0x00000001ac880f6c <system symbols missing>
    11. 9   UIKitCore                          0x00000001ad3316f4 <system symbols missing>
    12. 10  UIKitCore                          0x00000001ac880d60 <system symbols missing>
    13. 11  UIKitCore                          0x00000001ac880c38 <system symbols missing>
    14. 12  UIKitCore                          0x00000001acec4118 <system symbols missing>
    15. 13  UIKitCore                          0x00000001acec66f4 <system symbols missing>
    16. 14  UIKitCore                          0x00000001acec6c08 <system symbols missing>
    17. 15  UIKitCore                          0x00000001acec5fdc <system symbols missing>
    18. 16  UIKitCore                          0x00000001ac76d0b4 <system symbols missing>
    19. 17  UIKitCore                          0x00000001ac76cdf8 <system symbols missing>
    20. 18  UIKitCore                          0x00000001ac762ab0 <system symbols missing>
    21. 19  UIKitCore                          0x00000001ac856100 <system symbols missing>
    22. 20  UIKitCore                          0x00000001ad32c16c <system symbols missing>
    23. 21  UIKitCore                          0x00000001ac855f7c <system symbols missing>
    24. 22  UIKitCore                          0x00000001ad32c16c <system symbols missing>
    25. 23  UIKitCore                          0x00000001ac855c30 <system symbols missing>
    26. 24  UIKitCore                          0x00000001ac855308 <system symbols missing>
    27. 25  UIKitCore                          0x00000001ac854d70 <system symbols missing>
    28. 26  UIKitCore                          0x00000001ac857478 <system symbols missing>
    29. 27  UIKitCore                          0x00000001acebdb50 <system symbols missing>
    30. 28  UIKitCore                          0x00000001ac84f22c <system symbols missing>
    31. 29  UIKitCore                          0x00000001acebd7f0 <system symbols missing>
    32. 30  UIKitCore                          0x00000001acebdcfc <system symbols missing>
    33. 31  UnityFramework                     0x00000001060133b8 UnityCleanupTrampoline (UnityAppController.mm:174)
    34. 32  UnityFramework                     0x00000001060144d8 -[UnityAppController applicationWillTerminate:] (UnityAppController.mm:498)
    35. 33  UIKitCore                          0x00000001ace8a9a4 <system symbols missing>
    36. 34  UIKitCore                          0x00000001ac6280d4 <system symbols missing>
    37. 35  UIKitCore                          0x00000001ac627d5c <system symbols missing>
    38. 36  UIKitCore                          0x00000001ace80b44 <system symbols missing>
    39. 37  FrontBoardServices                 0x00000001adf518a0 <system symbols missing>
    40. 38  FrontBoardServices                 0x00000001adf7c9bc <system symbols missing>
    41. 39  FrontBoardServices                 0x00000001adf62bfc <system symbols missing>
    42. 40  FrontBoardServices                 0x00000001adf7c94c <system symbols missing>
    43. 41  libdispatch.dylib                  0x00000001a8a97524 <system symbols missing>
    44. 42  libdispatch.dylib                  0x00000001a8a40434 <system symbols missing>
    45. 43  FrontBoardServices                 0x00000001adfa1850 <system symbols missing>
    46. 44  FrontBoardServices                 0x00000001adfa151c <system symbols missing>
    47. 45  FrontBoardServices                 0x00000001adfa1a44 <system symbols missing>
    48. 46  CoreFoundation                     0x00000001a8d4fad8 <system symbols missing>
    49. 47  CoreFoundation                     0x00000001a8d4fa30 <system symbols missing>
    50. 48  CoreFoundation                     0x00000001a8d4f1b8 <system symbols missing>
    51. 49  CoreFoundation                     0x00000001a8d4a1e8 <system symbols missing>
    52. 50  CoreFoundation                     0x00000001a8d49ba8 <system symbols missing>
    53. 51  GraphicsServices                   0x00000001b2eb9344 <system symbols missing>
    54. 52  UIKitCore                          0x00000001ace853e4 <system symbols missing>
    55. 53  UnityFramework                     0x0000000106018a28 -[UnityFramework runUIApplicationMainWithArgc:argv:] (main.mm:96)
    56. 54  [APPNAME]                    0x00000001049fbe1c main (main.mm:28)
    57. 55  libdyld.dylib                      0x00000001a8bd18f0 <system symbols missing>
     
  2. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    same issue here with 2019.4.9f1 and 2019.4.10f1
     
  3. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    We temporarily "fixed" this by not calling UnityUseAnimatedAutorotation while terminating:

    if (!isTerminating)
    [UIView setAnimationsEnabled: UnityUseAnimatedAutorotation() ? YES : NO];
     
  4. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    sigh not this again: apple started to do more and more things with views on app shutdown.

    >>We temporarily "fixed" this by not calling UnityUseAnimatedAutorotation while terminating:
    this is a perfectly fine fix

    can you report a bug (no need to attach project, sure) with all this information so it can be tracked?
     
  5. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Last edited: Sep 16, 2020
  6. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    well this time 1) it is impossible to just reproduce 2) we have all the information 3) you can always say in the bug "alexey told me to do just this" ;-)

    anyway: 1198042 is about "Crash on Android plugin CallStatic", so i assume you meant 1278124 ;-)
     
  7. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Now that sounds good ;) submitting impossible bugs to reproduce in future only ;)

    Thanks, edited!
     
  8. JSC-Sparkling

    JSC-Sparkling

    Joined:
    Sep 27, 2019
    Posts:
    4
    In Unity release 2019.4.13f1 the case number
    1278124
    was mentioned as being fixed.

    After updating our project to this unity version, we still receive the same crash (although far less than before):
    Code (CSharp):
    1.  
    2. Native StackTrace:
    3.  
    4. Thread 0 (crashed)
    5. 0   UnityFramework                     0x0000000104dfc808 UnityUseAnimatedAutorotation (TrampolineGlue.mm:46)
    6. 1   UnityFramework                     0x000000010401dc94 -[UnityViewControllerBase(iOS) viewWillTransitionToSize:withTransitionCoordinator:] (UnityViewControllerBase+iOS.mm:90)
    7. 2   UIKitCore                          0x000000019e122228 <system symbols missing>
    8. 3   UIKitCore                          0x000000019e137f78 <system symbols missing>
    9. 4   UIKitCore                          0x000000019e797ac0 <system symbols missing>
    10. 5   UIKitCore                          0x000000019e797814 <system symbols missing>
    11. 6   UIKitCore                          0x000000019e7a3b5c <system symbols missing>
    12. 7   UIKitCore                          0x000000019e7999c8 <system symbols missing>
    13. 8   UIKitCore                          0x000000019e153f68 <system symbols missing>
    14. 9   UIKitCore                          0x000000019ec046f4 <system symbols missing>
    15. 10  UIKitCore                          0x000000019e153d5c <system symbols missing>
    16. 11  UIKitCore                          0x000000019e153c34 <system symbols missing>
    17. 12  UIKitCore                          0x000000019e797118 <system symbols missing>
    18. 13  UIKitCore                          0x000000019e7996f4 <system symbols missing>
    19. 14  UIKitCore                          0x000000019e799c08 <system symbols missing>
    20. 15  UIKitCore                          0x000000019e798fdc <system symbols missing>
    21. 16  UIKitCore                          0x000000019e0400b0 <system symbols missing>
    22. 17  UIKitCore                          0x000000019e03fdf4 <system symbols missing>
    23. 18  UIKitCore                          0x000000019e035aac <system symbols missing>
    24. 19  UIKitCore                          0x000000019e1290fc <system symbols missing>
    25. 20  UIKitCore                          0x000000019ebff16c <system symbols missing>
    26. 21  UIKitCore                          0x000000019e128f78 <system symbols missing>
    27. 22  UIKitCore                          0x000000019ebff16c <system symbols missing>
    28. 23  UIKitCore                          0x000000019e128c2c <system symbols missing>
    29. 24  UIKitCore                          0x000000019e128304 <system symbols missing>
    30. 25  UIKitCore                          0x000000019e127d6c <system symbols missing>
    31. 26  UIKitCore                          0x000000019e12a474 <system symbols missing>
    32. 27  UIKitCore                          0x000000019e790b50 <system symbols missing>
    33. 28  UIKitCore                          0x000000019e122228 <system symbols missing>
    34. 29  UIKitCore                          0x000000019e7907f0 <system symbols missing>
    35. 30  UIKitCore                          0x000000019e790cfc <system symbols missing>
    36. 31  UnityFramework                     0x0000000104012818 UnityCleanupTrampoline (UnityAppController.mm:174)
    37. 32  UnityFramework                     0x0000000104013938 -[UnityAppController applicationWillTerminate:] (UnityAppController.mm:498)
    38. 33  UIKitCore                          0x000000019e75d9a4 <system symbols missing>
    39. 34  UIKitCore                          0x000000019defb0d0 <system symbols missing>
    40. 35  UIKitCore                          0x000000019defad58 <system symbols missing>
    41. 36  UIKitCore                          0x000000019e753b44 <system symbols missing>
    42. 37  FrontBoardServices                 0x000000019f8248a0 <system symbols missing>
    43. 38  FrontBoardServices                 0x000000019f84f9bc <system symbols missing>
    44. 39  FrontBoardServices                 0x000000019f835bfc <system symbols missing>
    45. 40  FrontBoardServices                 0x000000019f84f94c <system symbols missing>
    46. 41  libdispatch.dylib                  0x000000019a36a524 <system symbols missing>
    47. 42  libdispatch.dylib                  0x000000019a313434 <system symbols missing>
    48. 43  FrontBoardServices                 0x000000019f874850 <system symbols missing>
    49. 44  FrontBoardServices                 0x000000019f87451c <system symbols missing>
    50. 45  FrontBoardServices                 0x000000019f874a44 <system symbols missing>
    51. 46  CoreFoundation                     0x000000019a622ad8 <system symbols missing>
    52. 47  CoreFoundation                     0x000000019a622a30 <system symbols missing>
    53. 48  CoreFoundation                     0x000000019a6221b8 <system symbols missing>
    54. 49  CoreFoundation                     0x000000019a61d1e8 <system symbols missing>
    55. 50  CoreFoundation                     0x000000019a61cba8 <system symbols missing>
    56. 51  GraphicsServices                   0x00000001a4793344 <system symbols missing>
    57. 52  UIKitCore                          0x000000019e7583e4 <system symbols missing>
    58. 53  UnityFramework                     0x0000000104017e88 -[UnityFramework runUIApplicationMainWithArgc:argv:] (main.mm:96)
    59. 54  [APPNAME]                    0x0000000102aabe1c main (main.mm:28)
    60. 55  libdyld.dylib                      0x000000019a4a48f0 <system symbols missing>
    61.  
    62.  
     
  9. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    that sounds very weird - it should be in a different place (different line)
    and i can confirm the fix should be in 2019.4.13f1
     
  10. JSC-Sparkling

    JSC-Sparkling

    Joined:
    Sep 27, 2019
    Posts:
    4
    I'm not sure if the fix was applied directly to the affected file, but I've compared the
    UnityViewControllerBase+iOS.mm
    files of both 2019.4.13f1 and 2019.4.9f1 and there's no difference in their content...
     
  11. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    >>but I've compared the UnityViewControllerBase+iOS.mm files
    nono, the fix was in unity library itself
     
  12. chriscgogii

    chriscgogii

    Joined:
    Jun 2, 2017
    Posts:
    4
    Ended up hitting a very similar issue, in 2019.4.19f1, so far causing 1003 crashes and effecting 817 users.
    in my case the app is landscape only but looking at ours logs it happens before or after a ad is viewed by the user. so my assumption is that ad is portrait and causing it to animate into a new orientation.

    got my stack trace for it here

    Code (CSharp):
    1.