<compiler-generated> line 0 Controller.tableView(_:cellForRowAt:)

I have a crash that I cannot replicate in emulators or devices, it happens in the cellForRowAt of my main controller. Generate the version with Xcode 11 (gm seed 2), and the error is presented in all models with iOS between 10 and 12.


Crashed: com.apple.main-thread

EXC_BREAKPOINT 0x00000001014929b4

Crashed: com.apple.main-thread

0 kavakApp 0x1014929b4 Controller.tableView(_:cellForRowAt:) (<compiler-generated>)

1 kavakApp 0x101492a44 @objc Controller.tableView(_:cellForRowAt:) (<compiler-generated>)

2 UIKitCore 0x1eef22618 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 680

3 UIKitCore 0x1eef22b18 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 80

4 UIKitCore 0x1eeeef294 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2120

5 UIKitCore 0x1eef0c640 -[UITableView layoutSubviews] + 140

6 UIKitCore 0x1ef19b170 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1292

7 QuartzCore 0x1c692fc60 -[CALayer layoutSublayers] + 184

8 QuartzCore 0x1c6934c08 CA::Layer::layout_if_needed(CA::Transaction*) + 332

9 QuartzCore 0x1c68973e4 CA::Context::commit_transaction(CA::Transaction*) + 348

10 QuartzCore 0x1c68c5620 CA::Transaction::commit() + 640

11 UIKitCore 0x1eed2aad8 _afterCACommitHandler + 224

12 CoreFoundation 0x1c2383d08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32

13 CoreFoundation 0x1c237ea30 __CFRunLoopDoObservers + 412

14 CoreFoundation 0x1c237efac __CFRunLoopRun + 1228

15 CoreFoundation 0x1c237e7c0 CFRunLoopRunSpecific + 436

16 GraphicsServices 0x1c457f79c GSEventRunModal + 104

17 UIKitCore 0x1eed03c38 UIApplicationMain + 212

18 kavakApp 0x1012f2540 main + 25 (AppDelegate.swift:25)

19 libdyld.dylib 0x1c1e428e0 start + 4



Thanks for your support!

Hugo

Replies

Is this crash report excerpt from an Apple crash report? Or a crash report generated by a third-party crash reporter?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

The previous one was generated by a third-party crash reporter.

This is the information from the apple crash report:


Incident Identifier: E60649D2-C122-4160-952E-5A1F6CA1F9B2

CrashReporter Key: xxxxxxxx

Hardware Model: iPhone11,2

Process: kavakApp [436]

Path: /private/var/containers/Bundle/Application/xxxxxxx/xxxxxxxx.app/xxxxxxxxx

Identifier: com.xxxxxxxx

Version: 93 (1.6.3)

AppStoreTools: 11A1002b

AppVariant: 1:iPhone11,2:12.2

Code Type: ARM-64 (Native)

Role: Foreground

Parent Process: launchd [1]

Coalition: xxxxxxxxxxx [533]





Date/Time: 2019-09-19 15:52:20.4110 -0500

Launch Time: 2019-09-19 15:51:53.3541 -0500

OS Version: iPhone OS 13.0 (17A577)

Release Type: User

Baseband Version: 2.00.01-2

Report Version: 104



Exception Type: EXC_BREAKPOINT (SIGTRAP)

Exception Codes: 0x0000000000000001, 0x0000000100e0e9b4

Termination Signal: Trace/BPT trap: 5

Termination Reason: Namespace SIGNAL, Code 0x5

Terminating Process: exc handler [436]

Triggered by Thread: 0



Thread 0 name:

Thread 0 Crashed:

0 kavakApp 0x0000000100e0e9b4 Controller.tableView(_:cellForRowAt:) + 420 (<compiler-generated>:0)

1 kavakApp 0x0000000100e0ea44 @objc Controller.tableView(_:cellForRowAt:) + 140 (<compiler-generated>:0)

2 UIKitCore 0x0000000190fef488 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 644 (UITableView.m:14355)

3 UIKitCore 0x0000000190fbc42c -[UITableView _updateVisibleCellsNow:] + 2368 (UITableView.m:2908)

4 UIKitCore 0x0000000190fd9ab4 -[UITableView layoutSubviews] + 140 (UITableView.m:9181)

5 UIKitCore 0x00000001912a75b0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2156 (UIView.m:16887)

6 libobjc.A.dylib 0x000000018cab3af0 -[NSObject performSelector:withObject:] + 68 (NSObject.mm:2182)

7 QuartzCore 0x000000019384dc0c -[CALayer layoutSublayers] + 292 (CALayer.mm:9558)

8 QuartzCore 0x000000019384df14 CA::Layer::layout_if_needed(CA::Transaction*) + 484 (CALayer.mm:9435)

9 QuartzCore 0x00000001938613fc CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140 (CALayer.mm:2418)

10 QuartzCore 0x00000001937a6184 CA::Context::commit_transaction(CA::Transaction*, double) + 296 (CAContextInternal.mm:1985)

11 QuartzCore 0x00000001937d1228 CA::Transaction::commit() + 684 (CATransactionInternal.mm:438)

12 UIKitCore 0x0000000190e2ed6c _afterCACommitHandler + 144 (UIApplication.m:3027)

13 CoreFoundation 0x000000018cd17f5c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1758)

14 CoreFoundation 0x000000018cd12bfc __CFRunLoopDoObservers + 420 (CFRunLoop.c:1868)

15 CoreFoundation 0x000000018cd131ac __CFRunLoopRun + 1292 (CFRunLoop.c:2910)

16 CoreFoundation 0x000000018cd12978 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)

17 GraphicsServices 0x0000000196e42534 GSEventRunModal + 108 (GSEvent.c:2246)

18 UIKitCore 0x0000000190e04f0c UIApplicationMain + 1940 (UIApplication.m:4687)

19 kavakApp 0x0000000100c6e540 main + 68 (AppDelegate.swift:25)

20 libdyld.dylib 0x000000018cb92f04 start + 4


Thread 1:

0 libsystem_pthread.dylib 0x000000018cab0c74 start_wqthread + 0



Thread 2:

0 libsystem_pthread.dylib 0x000000018cab0c74 start_wqthread + 0



Thread 3 name:

Thread 3:

0 libsystem_kernel.dylib 0x000000018cb66bc4 mach_msg_trap + 8

1 libsystem_kernel.dylib 0x000000018cb65fe0 mach_msg + 76 (mach_msg.c:103)

2 CoreFoundation 0x000000018cd1839c __CFRunLoopServiceMachPort + 220 (CFRunLoop.c:2575)

3 CoreFoundation 0x000000018cd13234 __CFRunLoopRun + 1428 (CFRunLoop.c:2931)

4 CoreFoundation 0x000000018cd12978 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)

5 Foundation 0x000000018d057008 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232 (NSRunLoop.m:374)

6 Foundation 0x000000018d056ee0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:421)

7 UIKitCore 0x0000000190e9ed4c -[UIEventFetcher threadMain] + 156 (UIEventFetcher.m:636)

8 Foundation 0x000000018d055c14 -[NSThread main] + 40 (NSThread.m:760)

9 Foundation 0x000000018d191278 __NSThread__start__ + 852 (NSThread.m:724)

10 libsystem_pthread.dylib 0x000000018caa8d60 _pthread_start + 128 (pthread.c:895)

11 libsystem_pthread.dylib 0x000000018cab0c88 thread_start + 8



Thread 4 name:

Thread 4:

0 libsystem_kernel.dylib 0x000000018cb66bc4 mach_msg_trap + 8

1 libsystem_kernel.dylib 0x000000018cb65fe0 mach_msg + 76 (mach_msg.c:103)

2 CoreFoundation 0x000000018cd1839c __CFRunLoopServiceMachPort + 220 (CFRunLoop.c:2575)

3 CoreFoundation 0x000000018cd13234 __CFRunLoopRun + 1428 (CFRunLoop.c:2931)

4 CoreFoundation 0x000000018cd12978 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)

5 Foundation 0x000000018d057008 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232 (NSRunLoop.m:374)

6 Foundation 0x000000018d0922c0 -[NSRunLoop(NSRunLoop) run] + 92 (NSRunLoop.m:399)

7 kavakApp 0x0000000100e970a0 +[GAI threadMain:] + 64

8 Foundation 0x000000018d055c14 -[NSThread main] + 40 (NSThread.m:760)

9 Foundation 0x000000018d191278 __NSThread__start__ + 852 (NSThread.m:724)

10 libsystem_pthread.dylib 0x000000018caa8d60 _pthread_start + 128 (pthread.c:895)

11 libsystem_pthread.dylib 0x000000018cab0c88 thread_start + 8



........

Much better.

The crash you’re seeing here,

EXC_BREAKPOINT
, is strongly indicative of a Swift trap. That is, Swift is checking some condition and that check has failed. A good example of this is the use of the force unwrap operator (
!
). If the value you unwrap is
nil
, you’ll trap kinda like this.

The problem here is that the specific site of the trap, frame 0 of thread 0, is in compiler-generated code. In some cases it’s obvious how to map such compiler-generated code to code that you wrote (indeed, frame 1 of thread 0 is one such case). In this case, however, that’s not true. It’s not at all clear what is causing Swift to trap here.

If I were in your shoes I’d disassemble

Controller.tableView(_:cellForRowAt:)
to see how it might trap in this place. Alas, that’s not for the faint of heart.

Alternatively, you can look through that method to uncover the possible reasons it might trap, and that investigate from there.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"