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

Question Many iOS crashes when the application is launching

Discussion in 'iOS and tvOS' started by IoannisFMG, Sep 29, 2023.

  1. IoannisFMG

    IoannisFMG

    Joined:
    Sep 4, 2020
    Posts:
    7
    Hello everyone,

    We are getting a serious amount of early crashes in Crashlytics.

    The crash is of type
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS


    Unfortunately the IL2CPP stacktrace is not that obvious to decipher, so if anyone has any pointers on what to look out for or where to start, it would be great.

    Code (CSharp):
    1. Crashed: IL2CPP Threadpool worker
    2. 0  UnityFramework                 0x185f07c il2cpp::vm::Class::SetupMethods(Il2CppClass*) + 1140 (Class.cpp:1140)
    3. 1  UnityFramework                 0x185f038 il2cpp::vm::Class::GetMethods(Il2CppClass*, void**) + 367 (Class.cpp:367)
    4. 2  UnityFramework                 0x180308c il2cpp::icalls::mscorlib::System::MonoType::GetConstructors_internal(Il2CppReflectionType*, int, Il2CppReflectionType*) + 322 (MonoType.cpp:322)
    5. 3  UnityFramework                 0x1809f9c il2cpp::icalls::mscorlib::System::RuntimeType::GetConstructors_native(Il2CppReflectionRuntimeType*, int) + 186 (RuntimeType.cpp:186)
    6. 4  UnityFramework                 0x278fa8c selector_thread(void*) (.cold.1) + 4433656460
    7. 5  UnityFramework                 0x278f908 selector_thread(void*) (.cold.1) + 4433656072
    8. 6  UnityFramework                 0x2791024 selector_thread(void*) (.cold.1) + 4433661988
    9. 7  UnityFramework                 0x27966d8 selector_thread(void*) (.cold.1) + 4433684184
    10. 8  UnityFramework                 0x2797fac selector_thread(void*) (.cold.1) + 4433690540
    11. 9  UnityFramework                 0x1ffd034 selector_thread(void*) (.cold.1) + 4425715764
    12. 10 UnityFramework                 0x1ffce4c selector_thread(void*) (.cold.1) + 4425715276
    13. 11 UnityFramework                 0x1e59878 selector_thread(void*) (.cold.1) + 4423997560
    14. 12 UnityFramework                 0x2793774 selector_thread(void*) (.cold.1) + 4433672052
    15. 13 UnityFramework                 0x28cf128 selector_thread(void*) (.cold.1) + 4434964776
    16. 14 UnityFramework                 0x1a789b4 selector_thread(void*) (.cold.1) + 4419930548
    17. 15 UnityFramework                 0x1d9cc5c selector_thread(void*) (.cold.1) + 4423224412
    18. 16 UnityFramework                 0x1f7a5e8 selector_thread(void*) (.cold.1) + 4425180648
    19. 17 UnityFramework                 0x27d7134 selector_thread(void*) (.cold.1) + 4433948980
    20. 18 UnityFramework                 0x282d1d0 selector_thread(void*) (.cold.1) + 4434301392
    21. 19 UnityFramework                 0x28d9158 selector_thread(void*) (.cold.1) + 4435005784
    22. 20 UnityFramework                 0x27d76ec selector_thread(void*) (.cold.1) + 4433950444
    23. 21 UnityFramework                 0x27d116c selector_thread(void*) (.cold.1) + 4433924460
    24. 22 UnityFramework                 0x27e9108 selector_thread(void*) (.cold.1) + 4434022664
    25. 23 UnityFramework                 0xcc494 RuntimeInvoker_FalseByte_t0111FAB8B8685667EDDAF77683F0D8F86B659056(void (*)(), MethodInfo const*, void*, void**) + 92143 (Il2CppInvokerTable.cpp:92143)
    26. 24 UnityFramework                 0x181afac worker_thread(void*) + 252 (ThreadPoolWorkerThread.cpp:252)
    27. 25 UnityFramework                 0x184c4b8 il2cpp::vm::ThreadStart(void*) + 727 (Thread.cpp:727)
    28. 26 UnityFramework                 0x181c70c il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
    29. 27 UnityFramework                 0x181e96c il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
    30. 28 libsystem_pthread.dylib        0x16b8 _pthread_start + 148
    31. 29 libsystem_pthread.dylib        0xb88 thread_start + 8
    Is it trying to instantiate a class and fails? If so, why would that be? Could it be code stripping? Is there any way to find the name of the class somehow?
    Am I completely off regarding what the code actually tries to do?

    If it helps, type
    t0111FAB8B8685667EDDAF77683F0D8F86B659056
    is
    System.Byte
    .

    The stack trace from the main thread in the majority of the cases is
    Code (CSharp):
    1. com.apple.main-thread
    2. 0  libsystem_kernel.dylib         0xca4 mach_msg2_trap + 8
    3. 1  libsystem_kernel.dylib         0x13b74 mach_msg2_internal + 80
    4. 2  libsystem_kernel.dylib         0x13e4c mach_msg_overwrite + 540
    5. 3  libsystem_kernel.dylib         0x11e8 mach_msg + 24
    6. 4  CoreFoundation                 0x79024 __CFRunLoopServiceMachPort + 160
    7. 5  CoreFoundation                 0x7a250 __CFRunLoopRun + 1208
    8. 6  CoreFoundation                 0x7f3ec CFRunLoopRunSpecific + 612
    9. 7  GraphicsServices               0x135c GSEventRunModal + 164
    10. 8  UIKitCore                      0x39cf58 -[UIApplication _run] + 888
    11. 9  UIKitCore                      0x39cbbc UIApplicationMain + 340
    12. 10 UnityFramework                 0x1460c -[UnityFramework runUIApplicationMainWithArgc:argv:] + 96 (main.mm:96)
    13. 11 <game name>                       0x7cac main + 28 (main.mm:28)
    14. 12 ???                            0x1c012cdec (Missing)
    Unfortunately, we weren't able to reproduce this on our devices.


    Any pointers greatly appreciated!
    -Ioannis.
     
    Last edited: Sep 29, 2023
  2. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,058
    If you're using any native plugins, make sure those are all up to date as well.
    All packages in the package manager up to date as well?
    Have you experienced the crash yourself or are these only user reported crashes?
    Any particular moment that it crashes?
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,001
    I've had semi random crashes that would reliably happen 1-2 times per hour when we moved our project from 2020 to 2021, not sure if it's the same issue but disabling multithreaded rendering stopped the crashing for us.

    https://forum.unity.com/threads/crashing.1450249/
     
  4. IoannisFMG

    IoannisFMG

    Joined:
    Sep 4, 2020
    Posts:
    7
    To be honest we are using a bunch of SKDs and some of them might be a bit outdated.
    Also I don't think that's related to the new Unity. As I see, we are having this in 2020.3.45f1 too.

    I'm afraid, we couldn't reprocude the crash locally. Every data is from Crashlytics.
    There is no specific moment this crashes, other than when the app is early on launch. There are quite a few SDKs starting up at that moment, so that's why I would like some pointers, if someone can deduct something from the stacktrace.
     
  5. IoannisFMG

    IoannisFMG

    Joined:
    Sep 4, 2020
    Posts:
    7
    Thanks for the heads up!
    It seems that your issue comes from the rendering system, but our stacktrace doesn't mention something like that, afaik. So I don't think it has to do with that.

    Also, I have found out that the issue still happens in our "old" version of unity, so I don't think that the update is the issue.
    I have updated the thread title to reflect that.
     
    MaskedMouse and AcidArrow like this.
  6. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    349
    It seems to be the same issue with this, which has been fixed in latest versions, e.g. 2020.3.47:
     
    Last edited: Sep 29, 2023
    IoannisFMG likes this.
  7. IoannisFMG

    IoannisFMG

    Joined:
    Sep 4, 2020
    Posts:
    7
    Seems like a very probable match. We'll get onto updating to .47 and see the results.
    Greatly appreciated, Alan-Liu!
     
    Alan-Liu likes this.
  8. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,058
    If you updated the project to 2022.3 LTS, it should've been fixed already.
    Unity 2022.2.11 already fixed this.
    The issue tracker UUM-26516
     
  9. IoannisFMG

    IoannisFMG

    Joined:
    Sep 4, 2020
    Posts:
    7
    No no, the issue appears only on 2020.