Search Unity

Random crashes on iOS

Discussion in 'iOS and tvOS' started by papayagaming, Oct 16, 2019.

  1. papayagaming

    papayagaming

    Joined:
    May 28, 2019
    Posts:
    1
    Hi,

    We're seeing many crashes in our iOS app, with the following call stack:


    Crashed: Job.Worker 0
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000004

    0 bubblecash 0x102ef04c4 UI::Populate(UI::RenderableUIInstruction&, UI::UIInstruction const&, int, bool) + 152 (ExtendedAtomicOps-clang-gcc.h:152)
    1 bubblecash 0x102eee5d8 UI::GenerateRenderableUIInstructionJob(UI::PreprocessUIInstructionsData*, unsigned int) + 151 (UIJobs.cpp:151)
    2 bubblecash 0x103100e6c JobQueue::Exec(JobInfo*, long long, int) + 549 (JobQueue.cpp:549)
    3 bubblecash 0x103101024 JobQueue::Steal(JobGroup*, JobInfo*, long long, int, bool) + 666 (JobQueue.cpp:666)
    4 bubblecash 0x1031011b4 JobQueue::ExecuteJobFromQueue() + 823 (JobQueue.cpp:823)
    5 bubblecash 0x103101450 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 966 (JobQueue.cpp:966)
    6 bubblecash 0x1031009c0 JobQueue::WorkLoop(void*) + 1054 (JobQueue.cpp:1054)
    7 bubblecash 0x103178b3c Thread::RunThreadWrapper(void*) + 87 (Thread.cpp:87)
    8 libsystem_pthread.dylib 0x181a481f0 _pthread_start + 124
    9 libsystem_pthread.dylib 0x181a4baf0 thread_start + 8

    Main Thread:
    com.apple.main-thread
    0 libsystem_kernel.dylib 0x181b02630 semaphore_wait_trap + 8
    1 libdispatch.dylib 0x18199f9b0 _dispatch_sema4_wait$VARIANT$mp + 24
    2 libdispatch.dylib 0x18199fff4 _dispatch_semaphore_wait_slow + 140
    3 bubblecash 0x103101d30 JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealFlags) + 31 (Semaphore.h:31)
    4 bubblecash 0x1030ff484 CompleteFenceInternal(JobFence&, WorkStealFlags) + 17 (Jobs.cpp:17)
    5 bubblecash 0x102ef4dfc UI::Canvas::UpdateBatches(bool) + 289 (Jobs.h:289)
    6 bubblecash 0x102eeae80 UI::CanvasManager::WillRenderCanvases() + 1476 (vector:1476)
    7 bubblecash 0x10312e238 ExecutePlayerLoop(NativePlayerLoopSystem*) + 281 (PlayerLoop.cpp:281)
    8 bubblecash 0x10312e26c ExecutePlayerLoop(NativePlayerLoopSystem*) + 299 (PlayerLoop.cpp:299)
    9 bubblecash 0x10312e450 PlayerLoop() + 356 (PlayerLoop.cpp:356)
    10 bubblecash 0x1033d80c0 UnityPlayerLoopImpl(bool) + 287 (LibEntryPoint.mm:287)
    11 bubblecash 0x102bc1a00 UnityRepaint + 279 (UnityAppController+Rendering.mm:279)
    12 bubblecash 0x102bc18ec -[UnityAppController(Rendering) repaintDisplayLink] + 72 (UnityAppController+Rendering.mm:72)
    13 QuartzCore 0x18854cdd4 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 632
    14 IOKit 0x182c601a0 IODispatchCalloutFromCFMessage + 488
    15 CoreFoundation 0x181c7fff8 __CFMachPortPerform + 172
    16 CoreFoundation 0x181ca970c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    17 CoreFoundation 0x181ca8e38 __CFRunLoopDoSource1 + 444
    18 CoreFoundation 0x181ca3d0c __CFRunLoopRun + 2168
    19 CoreFoundation 0x181ca316c CFRunLoopRunSpecific + 464
    20 GraphicsServices 0x18badb328 GSEventRunModal + 104
    21 UIKitCore 0x185d0dd0c UIApplicationMain + 1936
    22 bubblecash 0x102bba920 main + 41 (main.mm:41)
    23 libdyld.dylib 0x181b2e424 start + 4


    Unity Version: 2019.1.11
    iOS Version: Multiple (from 11.0 to 13.1 and probably others)
    iOS Device: Multiple iPhone and iPad models
    Xcode Version: 11 (used to build)

    We cannot reproduce those crashes but they happen quite often to our users.

    Did anyone else encounter such crashes? Any ideas?

    Thank you!
     
    Turborilla likes this.
  2. MateuszKorzeniowski

    MateuszKorzeniowski

    Joined:
    Jul 2, 2019
    Posts:
    2
    We are facing the exact same crashes on iOS. Did you find a solution?
     
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Have you considered moving to a newer version of Unity?

    Unity 2019.1.11 is not only a tech release (non-LTS) but it's also old and no longer supported. I believe Xcode 11 is no longer supported as well.

    It might be that newer iOS versions have changes that do not work as well with older Unity & Xcode versions.

    Personally I found the move from 2019 to 2020 fairly easy, but I guess that depends on the complexity of your project.
     
    Last edited: Aug 9, 2022
  4. MateuszKorzeniowski

    MateuszKorzeniowski

    Joined:
    Jul 2, 2019
    Posts:
    2
    We can reproduce it on Unity version 2020.3.32f1 and Xcode 13.0.
    Most often this error occurs on devices older than iPhone 8.

    I was hoping you were able to catch the "impostor" and give us an idea of a solution
     
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    I am using 2020.3.36f1 & Xcode 13.2.1 and find that combination stable enough. That said, given the current iOS market shares, my games target iOS 12 and newer. Maintaining support for older operating system versions becomes harder and harder, no matter which platform you use

    I don't work for Unity, just another developer trying to help with the experience I have. Hopefully someone from Unity will comment and help you further.
     
    Last edited: Aug 9, 2022