Does anybody see what's wrong? I have this type of crash (
Crashed: com.apple.main-thread SIGABRT ABORT 0x000000018f2c82ec) and I don't see why it crashes in init method of UIActivityIndicatorView.
I don't understand how it's possible to crash in the init method in general.
The problem is that I am not able to reproduce it, but it happens to random users.
Thank you in advance for any help
/// Displays mini loader animation.
class FTActivityIndicator: UIActivityIndicatorView {
func show(on view: UIView, center: CGPoint? = nil, size: CGSize? = nil) {
transform = .identity
isHidden = false
view.addSubview(self)
view.bringSubviewToFront(self)
startAnimating()
snp.remakeConstraints {
if let size = size {
$0.size.equalTo(size)
} else {
$0.size.equalToSuperview()
}
if let center = center {
$0.center.equalTo(center)
} else {
$0.center.equalToSuperview()
}
}
}
func hide(completion: (() -> Void)? = nil) {
stopAnimating()
removeFromSuperview()
completion?()
}
}
/// Displays mini loader animation.
final class MiniLoader: FTActivityIndicator {
var isPlaying: Bool {
get { return isAnimating }
set {
if newValue == true {
startAnimating()
} else {
stopAnimating()
}
}
}
init() {
super.init(style: UIActivityIndicatorView.Style.whiteLarge)
color = UIColor.white
hidesWhenStopped = true
alpha = 0.7
}
required convenience init(coder: NSCoder) {
self.init()
}
}Stack trace:
Crashed: com.apple.main-thread SIGABRT ABORT 0x00000001833672e8
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1833672e8 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18347b85c pthread_kill + 392
2 libsystem_c.dylib 0x1832d6368 abort + 140
3 libsystem_malloc.dylib 0x1833a8414 szone_error + 422
4 libsystem_malloc.dylib 0x1833b2668 + 36
5 libsystem_malloc.dylib 0x1833b2d44 + 1748
6 libsystem_malloc.dylib 0x1833b2eb0 + 360
7 CoreFoundation 0x183808a4c + 14264
8 CoreFoundation 0x183808f34 _CFStringCreateWithFormatAndArgumentsAux2 + 132
9 Foundation 0x18415a834 + 68
10 UIKit 0x18c8b3f2c + 584
11 UIKit 0x18c3b4668 + 696
12 UIKit 0x18c3b6858 + 180
13 FuboTV 0x101052cd4 @objc FTActivityIndicator.init(style:) + 4306922708
14 FuboTV 0x101052d64 @objc MiniLoader.init() + 55 (MiniLoader.swift:55)
15 FuboTV 0x100fe1d08 CarouselView.init(title:type:contentPage:seeMoreEnabled:moreCellTitle:focusPosition:isInVisibleRange:) + 39 (CarouselView.swift:39)
16 FuboTV 0x100f4ad38 ContentPageConfigurationOperation.main() (CarouselView.swift)
17 FuboTV 0x100f4c6d8 @objc ContentPageConfigurationOperation.main() ()
18 Foundation 0x184170594 + 848
19 Foundation 0x184240704 + 404
20 libdispatch.dylib 0x1832026d4 + 16
21 libdispatch.dylib 0x183206fb4 _dispatch_main_queue_callback_4CF + 1016
22 CoreFoundation 0x1837f1834 + 12
23 CoreFoundation 0x1837ef410 + 2012
24 CoreFoundation 0x18370f328 CFRunLoopRunSpecific + 436
25 GraphicsServices 0x1855ccf84 GSEventRunModal + 100
26 UIKit 0x18c3c3030 UIApplicationMain + 236
27 FuboTV 0x100d91554 main + 22 (Team.swift:22)
28 libdyld.dylib 0x1832379f8 + 4
Thread #1
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #2
0 libsystem_pthread.dylib 0x183476f88 pthread_workqueue_addthreads_np + 122
Thread #3
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x183346568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1833463e0 mach_msg + 72
2 CoreFoundation 0x1837f15f8 + 196
3 CoreFoundation 0x1837ef1c4 + 1424
4 CoreFoundation 0x18370f328 CFRunLoopRunSpecific + 436
5 Foundation 0x184164664 + 304
6 Foundation 0x184183a3c + 96
7 UIKit 0x18ce16ed8 + 136
8 Foundation 0x184263f64 + 996
9 libsystem_pthread.dylib 0x183479860 + 308
10 libsystem_pthread.dylib 0x18347972c _pthread_start + 310
11 libsystem_pthread.dylib 0x183476f94 thread_start
Thread #4
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #5
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #6
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1834774f8 _pthread_wqthread + 1376
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #7
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1834774f8 _pthread_wqthread + 1376
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
com.apple.CFNetwork.HTTP2.HTTP2Stream
0 libsystem_kernel.dylib 0x183367be0 __ulock_wait + 8
1 libsystem_platform.dylib 0x1834747f8 + 216
2 libsystem_malloc.dylib 0x18339cd38 + 284
3 libsystem_malloc.dylib 0x18339cbac malloc_zone_malloc + 172
4 CoreFoundation 0x183709a0c _CFRuntimeCreateInstance + 348
5 CFNetwork 0x183e6f248 + 36
6 CFNetwork 0x183de9d18 CFHTTPMessageCreateEmpty + 64
7 CFNetwork 0x183f0b988 + 56
8 libdispatch.dylib 0x183202714 + 24
9 libdispatch.dylib 0x1832026d4 + 16
10 libdispatch.dylib 0x183210d20 + 528
11 libdispatch.dylib 0x183205a08 + 340
12 libdispatch.dylib 0x183211c04 + 404
13 libdispatch.dylib 0x1832183fc + 644
14 libsystem_pthread.dylib 0x183477398 _pthread_wqthread + 1024
15 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #8
0 libsystem_pthread.dylib 0x183476f88 pthread_workqueue_addthreads_np + 122
Thread #9
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #10
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x183477368 _pthread_wqthread + 976
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
Thread #11
0 libsystem_kernel.dylib 0x183367d80 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1834774f8 _pthread_wqthread + 1376
2 libsystem_pthread.dylib 0x183476f8c start_wqthread + 4
ComScore-StreamingAnalytics-1
0 libsystem_kernel.dylib 0x1833670f0 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x183478a4c + 640
2 ComScore 0x10172d5a4 ComScore::WaitableEvent::wait(int) const + 97 (__hidden#5149_:97)
3 ComScore 0x1016c20b8 ComScore::TasksThread::waitUntilNextTaskReady() const + 72 (__hidden#2989_:72)
4 ComScore 0x1016c1f40 ComScore::TasksThread::run() + 147 (__hidden#2981_:147)
5 ComScore 0x10172ddd8 ComScore::Thread::threadEntryPoint() + 106 (__hidden#5307_:106)
6 ComScore 0x101731a8c threadEntryProc + 859 (__hidden#5149_:859)
7 libsystem_pthread.dylib 0x183479860 + 308
8 libsystem_pthread.dylib 0x18347972c _pthread_start + 310
9 libsystem_pthread.dylib 0x183476f94 thread_start + 4
ComScore-TasksThread
0 libsystem_kernel.dylib 0x1833670f0 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x183478a4c + 640
2 ComScore 0x10172d5a4 ComScore::WaitableEvent::wait(int) const + 97 (__hidden#5149_:97)
3 ComScore 0x1016c2110 ComScore::TasksThread::waitUntilNextTaskReady() const + 151 (__hidden#79_:151)
4 ComScore 0x1016f367c ComScore::ReferrerTasksThread::run() + 147 (__hidden#2981_:147)
5 ComScore 0x10172ddd8 ComScore::Thread::threadEntryPoint() + 106 (__hidden#5307_:106)
6 ComScore 0x101731a8c threadEntryProc + 859 (__hidden#5149_:859)
7 libsystem_pthread.dylib 0x183479860 + 308
8 libsystem_pthread.dylib 0x18347972c _pthread_start + 310
9 libsystem_pthread.dylib 0x183476f94 thread_start + 4
ComScore-NetworkTasksThread
0 libsystem_kernel.dylib 0x1833670f0 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x183478a4c + 640
2 ComScore 0x10172d5a4 ComScore::WaitableEvent::wait(int) const + 97 (__hidden#5149_:97)
3 ComScore 0x1016c20b8 ComScore::TasksThread::waitUntilNextTaskReady() const + 72 (__hidden#2989_:72)
4 ComScore 0x1016f367c ComScore::ReferrerTasksThread::run() + 147 (__hidden#2981_:147)
5 ComScore 0x10172ddd8 ComScore::Thread::threadEntryPoint() + 106 (__hidden#5307_:106)
6 ComScore 0x101731a8c threadEntryProc + 859 (__hidden#5149_:859)
7 libsystem_pthread.dylib 0x183479860 + 308
8 libsystem_pthread.dylib 0x18347972c _pthread_start + 310
9 libsystem_pthread.dylib 0x183476f94 thread_start + 4
com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x183346568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1833463e0 mach_msg + 72
2 CoreFoundation 0x1837f15f8 + 196
3 CoreFoundation 0x1837ef1c4 + 1424
4 CoreFoundation 0x18370f328 CFRunLoopRunSpecific + 436
5 CFNetwork 0x183ffbe8c + 780
6 Foundation 0x184263f64 + 996
7 libsystem_pthread.dylib 0x183479860 + 308
8 libsystem_pthread.dylib 0x18347972c _pthread_start + 310
9 libsystem_pthread.dylib 0x183476f94 thread_start + 4
This is definitely a memory management problem. Looking at your backtrace, frames 3 through 0 indicate that the memory allocator killed your process because it detected memory corruption. My recommendation is that you apply the Standard Memory Debugging Tools to see if you can trigger it in your office.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"