Repository navigation
MGLMapView iOS 12.2 low fps, crash upon traitCollection change. #14232
Description
With iOS 12.2 released we've noticed odd behaviour with the MGLMapView.
When switching back and forth between a ViewController containing almost nothing but the MapView and any other ViewController, the MapView will at random times enter into a state where the actual rendered Map lags very very hard. If there are Annotations provided through the delegate methods inside the Map, these Annotations will move at about 2 fps where as the map will lag even further behind. Turning the device while the MapView is in this lagging state will cause the app to run into a crash. (The MapView is constrained to the edges of the Superview)
In our case it is a Tabbar that causes the switch between views, thus no new View is being initialised but the already loaded MapView is used. I think this might be very important for the behaviour to occur.
Another note is that the newer the device, the more likely the crash is to occur. The bug is very hard to reproduce on an iPhone SE, 6 etc. It's more likely to occur with an iPhone 8 and almost always occurs within seconds with an iPhone X.
Here is the crashlog:
Stacktrace
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x0000000195cf60dc libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000195d739b0 libsystem_pthread.dylib`pthread_kill$VARIANT$armv81 + 296
frame #2: 0x0000000195c4fea8 libsystem_c.dylib`abort + 140
frame #3: 0x000000019531c788 libc++abi.dylib`abort_message + 132
frame #4: 0x000000019531c91c libc++abi.dylib`default_terminate_handler() + 284
frame #5: 0x0000000195333e10 libobjc.A.dylib`_objc_terminate() + 140
frame #6: 0x0000000195328838 libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #7: 0x0000000195328434 libc++abi.dylib`__cxa_rethrow + 144
frame #8: 0x0000000195333bc8 libobjc.A.dylib`objc_exception_rethrow + 44
frame #9: 0x00000001960e43c0 CoreFoundation`CFRunLoopRunSpecific + 544
frame #10: 0x00000001982e479c GraphicsServices`GSEventRunModal + 104
frame #11: 0x00000001c258db68 UIKitCore`UIApplicationMain + 212
* frame #12: 0x000000010276c698 APPNAME`main at AppDelegate.swift:8:7
frame #13: 0x0000000195baa8e0 libdyld.dylib`start + 4
thread #6, name = 'com.apple.uikit.eventfetch-thread'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x0000000196ab1fcc Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
frame #6: 0x0000000196ab1e5c Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 96
frame #7: 0x00000001c2673540 UIKitCore`-[UIEventFetcher threadMain] + 136
frame #8: 0x0000000196bde6e4 Foundation`__NSThread__start__ + 984
frame #9: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #10: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #11: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #15, name = 'com.apple.NSURLConnectionLoader'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x00000001966fd74c CFNetwork`-[__CoreSchedulingSetRunnable runForever] + 216
frame #6: 0x0000000196bde6e4 Foundation`__NSThread__start__ + 984
frame #7: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #8: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #9: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #19, name = 'com.mapbox.mbgl.Worker 1'
frame #0: 0x0000000195cf5ee4 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000195d754a4 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 628
frame #2: 0x00000001952cd090 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x0000000105928eb0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::condition_variable::wait<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0::operator()() const::'lambda'()>(this=<unavailable>, __lk=<unavailable>)::$_0::operator()() const::'lambda'()) at __mutex_base:375:9 [opt]
frame #4: 0x0000000105928e9c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] mbgl::ThreadPool::ThreadPool(this=<unavailable>)::$_0::operator()() const at default_thread_pool.cpp:17 [opt]
frame #5: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] decltype(__f=<unavailable>)::$_0>(fp)()) std::__1::__invoke<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(mbgl::ThreadPool::ThreadPool(unsigned long)::$_0&&) at type_traits:4428 [opt]
frame #6: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(__t=<unavailable>)::$_0>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #7: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(__vp=0x000000028059fc20) at thread:352 [opt]
frame #8: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #9: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #10: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #20, name = 'com.mapbox.mbgl.Worker 2'
frame #0: 0x0000000195cf5ee4 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000195d754a4 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 628
frame #2: 0x00000001952cd090 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x0000000105928eb0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::condition_variable::wait<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0::operator()() const::'lambda'()>(this=<unavailable>, __lk=<unavailable>)::$_0::operator()() const::'lambda'()) at __mutex_base:375:9 [opt]
frame #4: 0x0000000105928e9c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] mbgl::ThreadPool::ThreadPool(this=<unavailable>)::$_0::operator()() const at default_thread_pool.cpp:17 [opt]
frame #5: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] decltype(__f=<unavailable>)::$_0>(fp)()) std::__1::__invoke<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(mbgl::ThreadPool::ThreadPool(unsigned long)::$_0&&) at type_traits:4428 [opt]
frame #6: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(__t=<unavailable>)::$_0>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #7: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(__vp=0x000000028059fc40) at thread:352 [opt]
frame #8: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #9: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #10: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #21, name = 'com.mapbox.mbgl.Worker 3'
frame #0: 0x0000000195cf5ee4 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000195d754a4 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 628
frame #2: 0x00000001952cd090 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x0000000105928eb0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::condition_variable::wait<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0::operator()() const::'lambda'()>(this=<unavailable>, __lk=<unavailable>)::$_0::operator()() const::'lambda'()) at __mutex_base:375:9 [opt]
frame #4: 0x0000000105928e9c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] mbgl::ThreadPool::ThreadPool(this=<unavailable>)::$_0::operator()() const at default_thread_pool.cpp:17 [opt]
frame #5: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] decltype(__f=<unavailable>)::$_0>(fp)()) std::__1::__invoke<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(mbgl::ThreadPool::ThreadPool(unsigned long)::$_0&&) at type_traits:4428 [opt]
frame #6: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(__t=<unavailable>)::$_0>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #7: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(__vp=0x000000028059fca0) at thread:352 [opt]
frame #8: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #9: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #10: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #22, name = 'com.mapbox.mbgl.Worker 4'
frame #0: 0x0000000195cf5ee4 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000195d754a4 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 628
frame #2: 0x00000001952cd090 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x0000000105928eb0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::condition_variable::wait<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0::operator()() const::'lambda'()>(this=<unavailable>, __lk=<unavailable>)::$_0::operator()() const::'lambda'()) at __mutex_base:375:9 [opt]
frame #4: 0x0000000105928e9c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] mbgl::ThreadPool::ThreadPool(this=<unavailable>)::$_0::operator()() const at default_thread_pool.cpp:17 [opt]
frame #5: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] decltype(__f=<unavailable>)::$_0>(fp)()) std::__1::__invoke<mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(mbgl::ThreadPool::ThreadPool(unsigned long)::$_0&&) at type_traits:4428 [opt]
frame #6: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0>(__t=<unavailable>)::$_0>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #7: 0x0000000105928ce0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::ThreadPool::ThreadPool(unsigned long)::$_0> >(__vp=0x000000028059fbc0) at thread:352 [opt]
frame #8: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #9: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #10: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #23, name = 'com.mapbox.mbgl.AssetFileSource'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x00000001960e50b0 CoreFoundation`CFRunLoopRun + 80
frame #6: 0x0000000105b022e0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] mbgl::util::RunLoop::run(this=<unavailable>) at run_loop.cpp:37:5 [opt]
frame #7: 0x0000000105b022dc Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(this=0x000000028268ed08)::'lambda'()::operator()() at thread.hpp:65 [opt]
frame #8: 0x0000000105b02228 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] decltype(__f=0x000000028268ed08)::'lambda'()>(fp)()) std::__1::__invoke<mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()>(mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()&&) at type_traits:4428 [opt]
frame #9: 0x0000000105b02228 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()>(__t=<unavailable>)::'lambda'()>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #10: 0x0000000105b02228 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::AssetFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(__vp=0x000000028268ed00) at thread:352 [opt]
frame #11: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #12: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #13: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #24, name = 'com.mapbox.mbgl.DefaultFileSource'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x00000001960e50b0 CoreFoundation`CFRunLoopRun + 80
frame #6: 0x0000000105b0536c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()> >(void*) [inlined] mbgl::util::RunLoop::run(this=<unavailable>) at run_loop.cpp:37:5 [opt]
frame #7: 0x0000000105b05368 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()> >(void*) [inlined] mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(this=<unavailable>)::'lambda'()::operator()() at thread.hpp:65 [opt]
frame #8: 0x0000000105b05224 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()> >(void*) [inlined] decltype(__f=<unavailable>)::'lambda'()>(fp)()) std::__1::__invoke<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()>(mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()&&) at type_traits:4428 [opt]
frame #9: 0x0000000105b05224 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()>(__t=<unavailable>)::'lambda'()>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #10: 0x0000000105b05224 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<mbgl::FileSource> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&)::'lambda'()> >(__vp=0x00000002821ae220) at thread:352 [opt]
frame #11: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #12: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #13: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #25, name = 'com.mapbox.mbgl.LocalFileSource'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x00000001960e50b0 CoreFoundation`CFRunLoopRun + 80
frame #6: 0x0000000105b0bf60 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] mbgl::util::RunLoop::run(this=<unavailable>) at run_loop.cpp:37:5 [opt]
frame #7: 0x0000000105b0bf5c Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(this=0x0000000281fd9bc8)::'lambda'()::operator()() at thread.hpp:65 [opt]
frame #8: 0x0000000105b0bef0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] decltype(__f=0x0000000281fd9bc8)::'lambda'()>(fp)()) std::__1::__invoke<mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()>(mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()&&) at type_traits:4428 [opt]
frame #9: 0x0000000105b0bef0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()>(__t=<unavailable>)::'lambda'()>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #10: 0x0000000105b0bef0 Mapbox`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::LocalFileSource::Impl>::Thread<>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::'lambda'()> >(__vp=0x0000000281fd9bc0) at thread:352 [opt]
frame #11: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #12: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #13: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #31
frame #0: 0x0000000195d7bcd0 libsystem_pthread.dylib`start_wqthread
thread #41
frame #0: 0x0000000195d7bcd0 libsystem_pthread.dylib`start_wqthread
thread #44
frame #0: 0x0000000195d7bcd0 libsystem_pthread.dylib`start_wqthread
thread #45, queue = 'com.apple.CoreLocation.0x157d20a60'
frame #0: 0x0000000195ceb148 libsystem_kernel.dylib`semaphore_timedwait_trap + 8
frame #1: 0x000000010917d528 libdispatch.dylib`_dispatch_sema4_timedwait + 64
frame #2: 0x000000010917de80 libdispatch.dylib`_dispatch_semaphore_wait_slow + 72
frame #3: 0x000000019ce3d804 CoreLocation`___lldb_unnamed_symbol15$$CoreLocation + 372
frame #4: 0x000000019ce42bd0 CoreLocation`___lldb_unnamed_symbol98$$CoreLocation + 348
frame #5: 0x000000019ce9b674 CoreLocation`___lldb_unnamed_symbol1781$$CoreLocation + 68
frame #6: 0x000000019ce9b5a0 CoreLocation`___lldb_unnamed_symbol1780$$CoreLocation + 140
frame #7: 0x000000019ce96d14 CoreLocation`___lldb_unnamed_symbol1671$$CoreLocation + 180
frame #8: 0x000000019ce96bcc CoreLocation`___lldb_unnamed_symbol1670$$CoreLocation + 60
frame #9: 0x000000019ce98f08 CoreLocation`___lldb_unnamed_symbol1719$$CoreLocation + 436
frame #10: 0x0000000195db0be4 libxpc.dylib`_xpc_connection_call_event_handler + 68
frame #11: 0x0000000195db0f48 libxpc.dylib`_xpc_connection_mach_event + 856
frame #12: 0x000000010917cd34 libdispatch.dylib`_dispatch_client_callout4 + 16
frame #13: 0x0000000109195ef0 libdispatch.dylib`_dispatch_mach_msg_invoke + 380
frame #14: 0x0000000109184a4c libdispatch.dylib`_dispatch_lane_serial_drain + 288
frame #15: 0x0000000109196d68 libdispatch.dylib`_dispatch_mach_invoke + 528
frame #16: 0x0000000109184a4c libdispatch.dylib`_dispatch_lane_serial_drain + 288
frame #17: 0x00000001091858b4 libdispatch.dylib`_dispatch_lane_invoke + 456
frame #18: 0x000000010918f77c libdispatch.dylib`_dispatch_workloop_worker_thread + 1148
frame #19: 0x0000000195d79114 libsystem_pthread.dylib`_pthread_wqthread + 304
frame #20: 0x0000000195d7bcd4 libsystem_pthread.dylib`start_wqthread + 4
thread #48, name = 'AVAudioSession Notify Thread'
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x00000001960e9cb4 CoreFoundation`__CFRunLoopServiceMachPort + 236
frame #3: 0x00000001960e4bc4 CoreFoundation`__CFRunLoopRun + 1360
frame #4: 0x00000001960e4354 CoreFoundation`CFRunLoopRunSpecific + 436
frame #5: 0x000000019bfa2378 AVFAudio`GenericRunLoopThread::Entry(void*) + 156
frame #6: 0x000000019bfccc60 AVFAudio`CAPThread::Entry(CAPThread*) + 88
frame #7: 0x0000000195d782c0 libsystem_pthread.dylib`_pthread_body + 128
frame #8: 0x0000000195d78220 libsystem_pthread.dylib`_pthread_start + 44
frame #9: 0x0000000195d7bcdc libsystem_pthread.dylib`thread_start + 4
thread #49, queue = 'com.twitter.crashlytics.ios.binary-images'
frame #0: 0x0000000195cf8920 libsystem_kernel.dylib`write + 8
frame #1: 0x0000000102efd604 APPNAME`CLSFileLoopWithWriteBlock + 56
frame #2: 0x0000000102efd870 APPNAME`CLSFileWriteToFileDescriptorOrBuffer + 212
frame #3: 0x0000000102efdb50 APPNAME`CLSFileWriteCollectionStart + 72
frame #4: 0x0000000102efda54 APPNAME`CLSFileWriteSectionStart + 28
frame #5: 0x0000000102ee4c00 APPNAME`__CLSBinaryImageChanged_block_invoke + 136
frame #6: 0x000000010917b6f0 libdispatch.dylib`_dispatch_call_block_and_release + 24
frame #7: 0x000000010917cc74 libdispatch.dylib`_dispatch_client_callout + 16
frame #8: 0x0000000109184bf4 libdispatch.dylib`_dispatch_lane_serial_drain + 712
frame #9: 0x00000001091858b4 libdispatch.dylib`_dispatch_lane_invoke + 456
frame #10: 0x000000010918f77c libdispatch.dylib`_dispatch_workloop_worker_thread + 1148
frame #11: 0x0000000195d79114 libsystem_pthread.dylib`_pthread_wqthread + 304
frame #12: 0x0000000195d7bcd4 libsystem_pthread.dylib`start_wqthread + 4
thread #50
frame #0: 0x0000000195ceb0f4 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x0000000195cea5a0 libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x0000000195ce6f10 libsystem_kernel.dylib`thread_info + 128
frame #3: 0x00000001042fc99c libBacktraceRecording.dylib`add_thread_info_to_list + 128
frame #4: 0x0000000195d79014 libsystem_pthread.dylib`_pthread_wqthread + 48
frame #5: 0x0000000195d7bcd4 libsystem_pthread.dylib`start_wqthread + 4Link Support Request
Mapbox Support Request Nr. 2612, Contact: Josh Erb (github: @riastrad)
Steps to reproduce
- Tabbar with two tabs, one where the MGLMapView resides, one where there is another ViewController
- Switch back and forth between these tabs on a fairly new iPhone such as the iPhone X
- MapView will adapt a state in which it is unusable to low fps
- Cause a traitCollection change -> Crash
Expected behavior
The MapView should stay fluent and usable no matter how often the user switches between tabs
Actual behavior
The MapView adapts a state where the fps is under 1 and interaction is not responded to anymore.
Configuration
Mapbox SDK versions:
Tested with version 4.9.0 all the way down to 4.5.0
iOS/macOS versions:
iOS 12.2, versions below work with no errors
Device/simulator models:
Most Prominent on the iPhone X and up, medium: iPhone 8, least prominent: iPhone 7 and below
Xcode version:
Version 10.2 (10E125)
Activity
JustinGanzer commentedon Mar 26, 2019
We tried other apps from the Appstore that are using Mapbox in combination with a UITabbarController and noticed they all are struck by the same bug.
julianrex commentedon Mar 26, 2019
Thanks for the report @JustinGanzer - we are investigating.
jmkiley commentedon Mar 26, 2019
Hi @JustinGanzer -
Thank you for the report! I was able to reproduce this issue with 4.9.0 and we are investigating the issue. Could you check whether you are seeing this issue with v4.10.0-beta.1?
technocidal commentedon Mar 26, 2019
Hey @jmkiley,
I'm on the same team of @JustinGanzer so I will try to help as well.
We are seeing this issue with the v4.10.0-beta.1 as well. It happens at around the same rate and the stack traces seem identical.
Stacktrace:
However sometimes when switching tabs the app does not crash immediately when rotating and instead this error gets thrown and the app changes into the last selected tab.
Error:
jmkiley commentedon Mar 26, 2019
Thank you for the additional information! I have not been able to replicate this issue with
v4.10.0-beta.1, but I am able to reproduce the inability to pan in Treble with Maps SDK v4.10.0-alpha.2 or earlier. Going to keep looking into it.Steps to repro:
Sometimes, I do have to switch back and forth between the Mapbox map and other maps a couple of times before I see the issue.
cc @friedbunny
julianrex commentedon Mar 28, 2019
@JustinGanzer @cyborgthefirst an update: we continue to investigate, and can reproduce - although as you note it's inconsistent and can take a while. However we can reproduce without having to rotate the device - so there are potentially 2 overlapping concerns here.
technocidal commentedon Mar 28, 2019
@julianrex Thank you for the update.
Luckily we have not gotten as much customer feedback about this issue as expected when first discovering it. If we can be of any additional aassistance please let us know.
julianrex commentedon Mar 28, 2019
Thanks @cyborgthefirst!
friedbunny commentedon Mar 28, 2019
Reproduction notes:
When the map becomes unresponsive, it’s evidently stuck in a series of one-second
semaphore_timedwait_traps, prompted by us callingglClear.Here’s the stacktrace from a symbolic breakpoint set on
semaphore_timedwait_trap, as the map becomes unresponsive:Other threads
Various Instruments confirm this sequence, but don’t really indicate why we’re failing to continue to render. The Metal System Trace profiling template indicates that the “Thread is blocked waiting for next drawable”:
jmkiley commentedon Mar 28, 2019
Thank you @friedbunny for the faster repro method.
git bisectseems to point to a995977, which addressed the user location annotation being jittery and annotations lagging. There is an Apple Developer forum post that looks a lot like the behavior @friedbunny noted above.a995977, includes
.presentsWithTransaction, which is also mentioned in the above forum post. That may be worth further investigation.julianrex commentedon Mar 29, 2019
@cyborgthefirst FYI we have a work-around that we're currently testing.
EDIT:
We were also seeing this when rapidly changing tabs and panning (but without rotation change).
julianrex commentedon Mar 29, 2019
@cyborgthefirst Looking at the call stack and
Can you set an exception breakpoint and see what the exception message is?
17 remaining items
julianrex commentedon Jun 6, 2019
Leaving this ticket open. When we do have confirmation, we'll want to:
MGLMapViewand easier to remove in the future.julianrex commentedon Jun 20, 2019
This bug appears to be present in iOS 13 beta 1 and 2 😞
We continue to test.
EDIT: After our initial reproduction, subsequent testing on multiple devices on 13 beta 2 hasn't managed to reproduce the bug. In fact, the behavior appears significantly improved. We are likely to proceed with limiting the work-around to 12.2.
We are planning to add error reporting to catch this in the wild: #15011
julianrex commentedon Jan 7, 2020
@JustinGanzer @cyborgthefirst have you seen this issue in iOS >= 13.1? This appears to have been fixed by Apple, so just wanted to double check with you.
stale commentedon Jul 5, 2020
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
captainbarbosa commentedon Jul 28, 2020
We should undo #14318 if it was indeed fixed by Apple 👀