Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Crash in enumerateDisplaysWithBlock using Metal

Discussion in 'iOS and tvOS' started by samizzo, Jul 20, 2017.

  1. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    482
    Hi,

    We've got an update in review with Apple which has been rejected because of an uncaught exception on launch in the UnityGfxDeviceWorker thread. This is the exception:

    *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <NSConcreteMapTable: 0x13dd8b3c0> was mutated while being enumerated.'

    The symbolicated callstack looks like this:
    Code (csharp):
    1. -[NSException name] (in CoreFoundation) + 0
    2. -[NSConcreteMapTable countByEnumeratingWithState:objects:count:] (in Foundation) + 76
    3. -[DisplayManager enumerateDisplaysWithBlock:] (in resynth) + 288
    4. UnityStartFrameRendering (in resynth) + 52
    5. GfxDeviceMetal::BeginFrame() (in resynth) (GfxDeviceMetal.mm:1606)
    6. GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) (in resynth) (GfxDeviceWorker.cpp:1053)
    7. GfxDeviceWorkerAutoreleasePoolProxy (in resynth) (GfxDeviceMetal.mm:1826)
    8. GfxDeviceWorker::Run() (in resynth) (GfxDeviceWorker.cpp:328)
    9. GfxDeviceWorker::RunGfxDeviceWorker(void*) (in resynth) (GfxDeviceWorker.cpp:316)
    10. Thread::RunThreadWrapper(void*) (in resynth) (Thread.cpp:44)
    We're using Unity 5.4.3f1. The device the tester was using was running iOS 10.3.1 and it was an iPhone 6s Plus (hardware model iPhone8,2).

    I haven't been able to find anything in the issue tracker about this. Is this a known crash? Has it been fixed in another Unity version? I haven't seen it happen before anywhere else on other iOS versions (I myself am on 10.3.2 at the moment and don't have a 10.3.1 device to test with).

    Thanks,
    Sam
     
  2. mclockw

    mclockw

    Joined:
    Jul 25, 2012
    Posts:
    3
    We have the same issue after we submit a test ipa to Testflight. We can run app on our device successfully, but Testflight Reviewer feedback this error. Our Unity version is 5.5.2f1.

    Code (CSharp):
    1.  
    2. Last Exception Backtrace:
    3. 0   CoreFoundation                    0x18a2211b8 0x18a0f1000 + 1245624
    4. 1   libobjc.A.dylib                   0x188c5855c 0x188c50000 + 34140
    5. 2   CoreFoundation                    0x18a220c00 0x18a0f1000 + 1244160
    6. 3   Foundation                        0x18ac3ba08 0x18ac2b000 + 68104
    7. 4   wzlz                              0x10002cb24 -[DisplayManager enumerateDisplaysWithBlock:] (DisplayManager.mm:322)
    8. 5   wzlz                              0x10002d654 UnityStartFrameRendering (DisplayManager.mm:504)
    9. 6   wzlz                              0x100df1180 GfxDeviceMetal::BeginFrame() (GfxDeviceMetal.mm:1855)
    10. 7   wzlz                              0x100a8ce94 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) (GfxDeviceWorker.cpp:442)
    11. 8   wzlz                              0x100df2660 GfxDeviceWorkerAutoreleasePoolProxy (GfxDeviceMetal.mm:2510)
    12. 9   wzlz                              0x100a8f1b0 GfxDeviceWorker::Run() (GfxDeviceWorker.cpp:344)
    13. 10  wzlz                              0x100a895e0 GfxDeviceWorker::RunGfxDeviceWorker(void*) (GfxDeviceWorker.cpp:308)
    14. 11  wzlz                              0x100caf7f8 Thread::RunThreadWrapper(void*) (Thread.cpp:35)
    15. 12  libsystem_pthread.dylib           0x1892b5850 0x1892b2000 + 14416
    16. 13  libsystem_pthread.dylib           0x1892b5760 0x1892b2000 + 14176
    17. 14  libsystem_pthread.dylib           0x1892b2d94 0x1892b2000 + 3476
    Mclockw
     
  3. simonmeijer

    simonmeijer

    Joined:
    May 22, 2017
    Posts:
    7
    Also experiencing this issue in 2017.3f1 and is crashing on iPad Air 2. I was wondering if you managed to find a solution.

    I did not recieve this error before and I do not know what caused it. I saw some similar posts about metal and multithreaded rendering so I am going to try to submit it for review with multithreaded rendering turned off.


    Last Exception Backtrace:

    0 CoreFoundation 0x180efb164 __exceptionPreprocess + 124 (NSException.m:166)
    1 libobjc.A.dylib 0x180144528 objc_exception_throw + 56 (objc-exception.mm:521)
    2 CoreFoundation 0x180efa7f0 __NSFastEnumerationMutationHandler + 128 (NSEnumerator.m:133)
    3 Foundation 0x1817f9d84 -[NSConcreteMapTable countByEnumeratingWithState:objects:count:] + 76 (NSMapTable.m:1018)
    4 --- 0x00000001009a1698 0x000000010098c000 + 87703
    5 --- 0x000000010099b3a8 -[UnityAppController(Rendering) callbackPresent:] + 62375 (UnityAppController+Rendering.mm:114)
    6 --- 0x000000010099b94c UnityPresentContextCallback + 63819 (UnityAppController+Rendering.mm:152)
    7 --- 0x000000010138f658 GfxDeviceMetal::PresentFrame() + 10499671 (GfxDeviceMetal.mm:2754)
    8 --- 0x000000010180d330 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) + 15209263 (GfxDeviceWorker.cpp:1165)
    9 --- 0x0000000101390ce8 GfxDeviceWorkerAutoreleasePoolProxy + 10505447 (GfxDeviceMetal.mm:3473)
    10 --- 0x000000010180decc GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) + 15212235 (GfxDeviceWorker.cpp:143)
    11 --- 0x00000001018061a0 GfxDeviceWorker::RunGfxDeviceWorker(void*) + 15180191 (GfxDeviceWorker.cpp:310)
    12 --- 0x000000010156381c Thread::RunThreadWrapper(void*) + 12417051 (Thread.cpp:36)
    13 libsystem_pthread.dylib 0x180b242b4 _pthread_body + 308 (pthread.c:740)
    14 libsystem_pthread.dylib 0x180b24180 _pthread_start + 312 (pthread.c:799)
    15 libsystem_pthread.dylib 0x180b22b74 thread_start + 4
     
  4. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    482
    I ended up updating to 5.4.3p4. I forget whether that was for something else or for this bug specifically. I haven't seen the bug since then, though. But you're on a different version entirely so it sounds like the bug is still there.. :/

    -Sam
     
  5. simonmeijer

    simonmeijer

    Joined:
    May 22, 2017
    Posts:
    7
    Hey Sam, thanks for your response. It could be a slightly different bug so if I find a solution I'll let you know.
     
  6. simonmeijer

    simonmeijer

    Joined:
    May 22, 2017
    Posts:
    7
    Hey Sam,

    The app passed the review. Disabling multithreaded rendering did the trick.
    Hope it will help someone.

    Simon
     
  7. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    This is still happening in 2017.4.0f1, yikes. Got my release delayed because of this.
     
unityunity