iOS 10 webview Collection <CALayerArray: 0xe0b8400> was mutated while being enumerated. crash

It was happen in webview.

Here are the crash stack frames:

All of the stacks belongs to system frameworks.

According to the tips , the subviews of one UIView were mutated when invock -[UIView(Hierarchy) subviews] function.

But I don't know it was caused by which UIView.


And I would happened only in iOS 10, would't happened in iOS 9.



  • 0 CoreFoundation 0x1afd5e07 ___exceptionPreprocess + 131
  • 1 libobjc.A.dylib 0x1a23b077 objc_exception_throw + 31
  • 2 CoreFoundation 0x1afd58a1 -[NSException name] + 1
  • 3 UIKit 0x200127f1 -[UIView(Hierarchy) subviews] + 403
  • 4 UIKit 0x20310f19 -[UIView(CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 67
  • 5 UIKit 0x20018897 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1341
  • 6 QuartzCore 0x1de443d9 -[CALayer layoutSublayers] + 127
  • 7 QuartzCore 0x1de385ef CA::Layer::layout_if_needed(CA::Transaction*) + 355
  • 8 QuartzCore 0x1de3847f CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 17
  • 9 QuartzCore 0x1ddc8f6b CA::Context::commit_transaction(CA::Transaction*) + 371
  • 10 QuartzCore 0x1dde7535 CA::Transaction::commit() + 565
  • 11 QuartzCore 0x1dde7fd3 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 163
  • 12 CoreFoundation 0x1af91485 ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
  • 13 CoreFoundation 0x1af8f701 ___CFRunLoopDoObservers + 283
  • 14 CoreFoundation 0x1aedf093 CFRunLoopRunSpecific + 515
  • 15 CoreFoundation 0x1aedee81 CFRunLoopRunInMode + 103
  • 16 WebCore 0x1f06b8a3 RunWebThread(void*) + 427
  • 17 libsystem_pthread.dylib 0x1a833a27 __pthread_body + 217
  • 18 libsystem_pthread.dylib 0x1a83394d _pthread_start + 229
  • 19 libsystem_pthread.dylib 0x1a8314a8 thread_start + 8
  • *** Collection <CALayerArray: 0xe0b8400> was mutated while being enumerated.
iOS 10 webview Collection &lt;CALayerArray: 0xe0b8400&gt; was mutated while being enumerated. crash
 
 
Q