Xcode symbolication error

I've been facing a weird crash lately (never faced this issue in the previous versions). Here is the crash log.

Incident Identifier: 6114D7FA-EF29-4740-881C-3CFBC4C2D6C5
CrashReporter Key:   af8eee1e8fed31df490071fdeac6889799efa78a
Hardware Model:      iPhone8,4
Process:             MyApp [337]
Path:                /private/var/containers/Bundle/Application/586EE43E-8537-483C-B84F-EE00BA943F35/MyApp.app/MyApp
Identifier:          com.getmyapp.MyApp
Version:             108 (3.16)
AppStoreTools:       10B63
AppVariant:          1:iPhone8,4:12
Code Type:           ARM-64 (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           com.getmyapp.MyApp [451]


Date/Time:           2018-11-29 08:11:11.5909 +0530
Launch Time:         2018-11-29 08:11:09.2156 +0530
OS Version:          iPhone OS 12.1 (16B92)
Baseband Version:    7.21.00
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001028431fc
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [337]
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   MyApp                        0x00000001028431fc MyAppTabBarController.setupMyAppHomeTabs() + 4452 (:0)
1   MyApp                        0x0000000102841afc closure #1 in MyAppTabBarController.initialSetup() + 1028 (MyAppTabBarController.swift:469)
2   MyApp                        0x000000010284b5fc closure #1 in static ServerCalls.myapp_init(request:listener:) + 772 (ServerCalls.swift:35)
3   MyApp                        0x0000000102854870 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed DataResponse) -> () + 48 (:0)
4   Alamofire                     0x0000000102d61188 partial apply for closure #1 in closure #1 in DataRequest.response(queue:responseSerializer:completionHandler:) + 56 (ResponseSerialization.swift:167)
5   Alamofire                     0x0000000102d41e78 thunk for @escaping @callee_guaranteed () -> () + 36 (:0)
6   libdispatch.dylib             0x00000001970916c8 _dispatch_call_block_and_release + 24 (init.c:1372)
7   libdispatch.dylib             0x0000000197092484 _dispatch_client_callout + 16 (object.m:511)
8   libdispatch.dylib             0x000000019703e9b4 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068 (inline_internal.h:2441)
9   CoreFoundation                0x00000001975e7dd0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1813)
10  CoreFoundation                0x00000001975e2c98 __CFRunLoopRun + 1964 (CFRunLoop.c:3113)
11  CoreFoundation                0x00000001975e21cc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
12  GraphicsServices              0x0000000199859584 GSEventRunModal + 100 (GSEvent.c:2245)
13  UIKitCore                     0x00000001c46d5054 UIApplicationMain + 212 (UIApplication.m:4347)
14  MyApp                        0x0000000102837fd0 main + 60 (VideoCollectionViewCell.swift:19)
15  libdyld.dylib                 0x00000001970a2bb4 start + 4


I have two issues with this crash.

The crash log is confusing. Unable to get the cause of the crash.

1   MyApp                        0x0000000102841afc closure #1 in MyAppTabBarController.initialSetup() + 1028 (MyAppTabBarController.swift:469)
2   MyApp                        0x000000010284b5fc closure #1 in static ServerCalls.myapp_init(request:listener:) + 772 (ServerCalls.swift:35)
3   MyApp                        0x0000000102854870 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed DataResponse) -> () + 48 (:0)
4   Alamofire                     0x0000000102d61188 partial apply for closure #1 in closure #1 in DataRequest.response(queue:responseSerializer:completionHandler:) + 56 (ResponseSerialization.swift:167)


I've searched online for similar issues others have faced. One solution I found was to use [weak self] inside the closure but that didn't work for me. Below is the corresponding code


_ = ServerCalls.myapp_init(request: myappInitRequest, listener: { [weak self] (response) in
    if let strongSelf = self {
        strongSelf.handleMyAppInitResponse(response)
    }
})



2. I think there is an issue with App symbols that are generated.

Previously whenever there was a crash due to uncaught exception, the line 45 in the above crash log pointed to AppDelegate. It was something like this.

20  MyApp                        0x0000000100516718 main + 56 (AppDelegate.swift:18)


But for the current version which was uploaded using Xcode 10.1 exception crashes point to

14  MyApp                        0x0000000102837fd0 main + 60 (VideoCollectionViewCell.swift:19)


There are no properties or methods on line 19 in VideoCollectionViewCell, there is a comment on line 19.


Can anybody tell me what I'm doing wrong in the first case?

Also has anyone faced a similar app symbols issue?


Thanks

This part of your crash report:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)

strongly implies that your code died because of a Swift safety check. For example, you might be force unwrapping an optional or accessing an array out of bounds.

As to the location of that code, there’s a lot of info in your backtrace:

0 … MyAppTabBarController.setupMyAppHomeTabs() + 4452 (:0)  
1 … closure #1 in MyAppTabBarController.initialSetup() + 1028 (MyAppTabBarController.swift:469)  
2 … closure #1 in static ServerCalls.myapp_init(request:listener:) + 772 (ServerCalls.swift:35)  
3 … partial apply for thunk for @escaping @callee_guaranteed (@guaranteed DataResponse) -> () + 48 (:0)  
4 … partial apply for closure #1 in closure #1 in DataRequest.response(queue:responseSerializer:completionHandler:) + 56 (ResponseSerialization.swift:167)  
5 … thunk for @escaping @callee_guaranteed () -> () + 36 (:0)  
6 … _dispatch_call_block_and_release + 24 (init.c:1372)

Let’s look at each of these frames in turn, starting at the deepest point of the stack:

  • Frame 6 is in general code that Dispatch uses to call out to a closure (in Objective-C this is a called a block, hence the function name). You typically see this when someone has scheduled a closure on a queue and Dispatch is that running that closure on that queue.

  • Frame 5 is Swift compiler-generated goo to bridge between the Objective-C block and the Swift closure. Note that the line number is

    :0
    , which strongly indicates that this is compiler-generated code that does not have a specific origin in your source code.
  • Frame 4 reveals where that closure came from, namely,

    DataRequest.response(queue:responseSerializer:completionHandler:)
    and specifically line 167 of
    ResponseSerialization.swift
    . This is part of the Alamofire library.
  • Frame 3 is more compiler-generated goo.

  • Frame 2 is another closure, this time in your code. It seems that you’ve called Alamofire and given this closure as a completion handler. This identifies that code is

    ServerCalls.myapp_init(request:listener:)
    on line 35 of
    ServerCalls.swift
    .
  • Frame 1 is yet another closure, still in your code. Specifically, it’s

    MyAppTabBarController.initialSetup()
    on line 469 of
    MyAppTabBarController.swift
    .
  • Frame 0 is the code that actually crashed. Again, this is compiler-generated code, so you don’t get a file name or line number, but it’s definitely associated with

    MyAppTabBarController.setupMyAppHomeTabs()
    .

To investigate this I’d look at

MyAppTabBarController.initialSetup()
to see what it’s doing on line 469. You’ll probably find that it’s doing something related to
MyAppTabBarController.setupMyAppHomeTabs()
that’s triggering this problem. It’s hard to say exactly what without seeing that part of your code.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
Xcode symbolication error
 
 
Q