Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App crashed in compiler generated code on iOS 12

Tags:

I have recently released a new version of an iOS app written in Swift 4.2 and Crashlytics reported the app crashed 30+ times in compiled generated code. I looked in the classes in my project and also tried to reproduce the crash unsuccessfully. Does anyone have a way of troubleshooting crashes that occur in compiler generated code? This is the crash log:

Crashed: com.apple.main-thread
0  dealers                        0x1008f184c $S7dealers20BrowseViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtF (<compiler-generated>)
1  dealers                        0x1008f18b0 $S7dealers20BrowseViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtFTo (<compiler-generated>)
2  UIKitCore                      0x1ced08de4 <redacted> + 684
3  UIKitCore                      0x1ced0932c <redacted> + 80
4  UIKitCore                      0x1cecd4a04 <redacted> + 2256
5  UIKitCore                      0x1cecf28f0 <redacted> + 140
6  UIKitCore                      0x1cef877dc <redacted> + 1380
7  QuartzCore                     0x1a5df9b74 -[CALayer layoutSublayers] + 184
8  QuartzCore                     0x1a5dfeb2c CA::Layer::layout_if_needed(CA::Transaction*) + 324
9  QuartzCore                     0x1a5d5d44c CA::Context::commit_transaction(CA::Transaction*) + 340
10 QuartzCore                     0x1a5d8bd7c CA::Transaction::commit() + 608
11 QuartzCore                     0x1a5cca170 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 324
12 QuartzCore                     0x1a5d9329c display_timer_callback(__CFMachPort*, void*, long, void*) + 272
13 CoreFoundation                 0x1a176601c __CFMachPortPerform + 188
14 CoreFoundation                 0x1a178d868 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
15 CoreFoundation                 0x1a178cfb4 __CFRunLoopDoSource1 + 440
16 CoreFoundation                 0x1a1787d6c __CFRunLoopRun + 2140
17 CoreFoundation                 0x1a17871f0 CFRunLoopRunSpecific + 436
18 GraphicsServices               0x1a3a00584 GSEventRunModal + 100
19 UIKitCore                      0x1ceaded40 UIApplicationMain + 212
20 dealers                        0x10079b8b4 main (AuctionDetailDocumentsSectionController.swift:22)
21 libdyld.dylib                  0x1a1246bb4 start + 4
like image 902
Hong Wei Avatar asked Jan 11 '19 01:01

Hong Wei


1 Answers

Upate: After countless hours, I realized it was due to the way that I implemented pull to refresh. When a pull to refresh event happened, I emptied out the backing collection but I did not reload table view. When I pull down the table view far enough and the table view bounced back from the bottom, it tries to load the bottom rows which triggers cell for row. The empty collection caused the crash.

like image 177
Hong Wei Avatar answered Oct 22 '22 11:10

Hong Wei