8 Replies
      Latest reply on Oct 11, 2019 12:00 PM by DaleOne
      DaleOne Level 1 Level 1 (0 points)

        Hi!

         

        I hope someone can help me.

         

        A user told me that my app crashes when scrolling a tableView on iOS 13.1.2.

        I received the crash log and the error it’s just crazy.

         

        The crash log indicate that the error is at the first line inside the trailingSwipeActionsConfigurationForRowAt method.

         

        override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
             guard items.count > indexPath.row else {return nil} //This line crash.
             …
        }

        The items property is defined as:

        private var items = [AnyObject]()

         

        The error is EXC_BREAKPOINT (SIGTRAP).

         

        How can this line of code crash? items is a non optional variable and indexPath is also a non optional struct.

        It's as if indexPath.row was deliberately creating an EXC_BREAKPOINT exception. It is possible?

         

        Another strange thing is that the user say that the app crash during scrolling. It seems that the method trailingSwipeActionsConfigurationForRowAt is called during scroll. That's also strange, it should not be called only when the user does a left swipe? Maybe it has something to do with some accessibility feature because in the call stack of crash report I see some system accessibility methods calls (see crash report below).

         

        Has anyone any ideas that can help me or has encountered a similar problem?

         

        Thank you

         

        Exception Type:  EXC_BREAKPOINT (SIGTRAP)
        Exception Codes: 0x0000000000000001, 0x00000001de522a94
        Termination Signal: Trace/BPT trap: 5
        Termination Reason: Namespace SIGNAL, Code 0x5
        Terminating Process: exc handler [1431]
        Triggered by Thread:  0
        
        
        Thread 0 name:
        Thread 0 Crashed:
        0   libswiftUIKit.dylib           0x00000001de522a94 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 52
        1   libswiftUIKit.dylib           0x00000001de522a78 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 24
        2   MYAPP                       0x000000010219ca4c specialized GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 272 (GroupTableViewController.swift:714)
        3   MYAPP                       0x0000000102194544 @objc GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 136 (:0)
        4   UIKitCore                     0x00000001ad6ae200 -[UITableView _trailingSwipeConfigurationAtIndexPath:fromRemoveButton:] + 2140 (UITableView.m:16580)
        5   UIKit                         0x00000001de7889f0 -[UITableViewCellAccessibility _privateAccessibilityCustomActions] + 544 (UITableViewCellAccessibility.m:3153)
        6   UIAccessibility               0x00000001b49e6228 -[NSObject(AXPrivCategory) _retrieveCustomActionsForElement:] + 72 (NSObjectAccessibility.m:2973)
        7   UIAccessibility               0x00000001b49e650c -[NSObject(AXPrivCategory) _accessibilityCustomActions] + 260 (NSObjectAccessibility.m:3021)
        8   UIAccessibility               0x00000001b49e9978 -[NSObject(AXPrivCategory) _accessibilityCustomActionNamesAndIdentifiers] + 68 (NSObjectAccessibility.m:3683)
        9   UIAccessibility               0x00000001b49f07bc -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 6580 (NSObjectAccessibility.m:6542)
        10  UIAccessibility               0x00000001b49d1d9c _copyMultipleAttributeValuesCallback + 544 (UIAccessibilityRuntime.m:344)
        11  AXRuntime                     0x00000001b39fc834 ___AXXMIGCopyMultipleAttributeValues_block_invoke + 64 (AccessibilityPriv.m:1192)
        12  AXRuntime                     0x00000001b39fc3a8 _handleNonMainThreadCallback + 68 (AccessibilityPriv.m:467)
        13  AXRuntime                     0x00000001b39fc6b8 _AXXMIGCopyMultipleAttributeValues + 304 (AccessibilityPriv.m:1191)
        14  AXRuntime                     0x00000001b39f658c _XCopyMultipleAttributeValues + 396 (AccessibilityClientDefsServer.c:1354)
        15  AXRuntime                     0x00000001b3a0bd28 mshMIGPerform + 272 (MachServerHelper.c:447)
        16  CoreFoundation                 0x00000001a939d91c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1937)
        17  CoreFoundation                 0x00000001a939cfe8 __CFRunLoopDoSource1 + 448 (CFRunLoop.c:2075)
        18  CoreFoundation                 0x00000001a9397c20 __CFRunLoopRun + 2144 (CFRunLoop.c:3098)
        19  CoreFoundation                 0x00000001a9397098 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
        20  GraphicsServices               0x00000001b3501534 GSEventRunModal + 108 (GSEvent.c:2246)
        21  UIKitCore                     0x00000001ad4b77ac UIApplicationMain + 1940 (UIApplication.m:4753)
        22  MYAPP                       0x000000010209cae8 main + 68 (PlaceViewController.swift:25)
        23  libdyld.dylib                 0x00000001a9216f30 start + 4
        • Re: Weird SIGTRAP during tableView scroll
          QuinceyMorris Level 8 Level 8 (6,050 points)

          How did you decide that it was the first line of that method where the crash happened? Are you sure this was line 714 of GroupTableViewController.swift when you built the version of the app that this user has?

           

          The backtrace is showing the error at byte offset 272. That seems kinda big for any machine-level instructions in such a simple line of code. Of course, there may be more going on than is obvious from the limited information shown here.

          • Re: Weird SIGTRAP during tableView scroll
            KMT Level 9 Level 9 (14,815 points)

            When attempting to interpret crash reports, it can be helpful to remember they simply point to where the error occured, not the root cause.

             

            In your example,  SIGTRAP is not the error, it is the exception. It doesn't show the origin of the crash.

             

            You might need to set break points, walking thru the UI/code so see if you can better id root cause related code block(s).

             

            In the mean time, does your app only support iOS 13.x? Which version Xcode are you using?

              • Re: Weird SIGTRAP during tableView scroll
                DaleOne Level 1 Level 1 (0 points)

                Unfortunately I'm unable to reproduce the error because it only happens to a single user. For this reason I cannot debug it.

                However as the stack showed several accessibility specific methods I asked the user to check if it had any active accessibility feature on the device. It told me that he had voice control turned on by mistake and that when he turned it off the problem disappeared.

                 

                I tried to enable voice control and run my app but I not get the error so maybe it's just an isolated case.


                The app support iOS 11 till iOS 13 and it's compiled with Xcode 11.1.

                 

                It would be really interesting to understand what this UIKit exception is:

                $s10Foundation9IndexPathV5UIKitE7sectionSivgTm

                  • Re: Weird SIGTRAP during tableView scroll
                    KMT Level 9 Level 9 (14,815 points)

                    About that exception, any time indexpath is involved, I think there might be chance, however small, of non-actionable, session based 'fragility' - might be some reading material here: https://developer.apple.com/documentation/foundation/indexpath

                     

                         >the error because it only happens to a single user -  so maybe it's just an isolated case.

                     

                    I'm tempted to agree, thanks for that info and good luck w/your app(s).

                     

                    Ken

                      • Re: Weird SIGTRAP during tableView scroll
                        DaleOne Level 1 Level 1 (0 points)

                        Thank you Ken!

                         

                        Now I only need to try to understand what do you mean by "non-actionable, session based fragility".

                        Do you mean that there are some cases when calling indexPath.row or indexPath.section can generate an exception? Interesting. Do you have any more information about this behavior?

                          • Re: Weird SIGTRAP during tableView scroll
                            KMT Level 9 Level 9 (14,815 points)

                            In simpler terms, means undefined, 'stuff happens', or as you already postulated 'weird'.

                             

                            That said, I can imagine edge cases where if that path is uncharacteristically long, perhaps on a device with already corrupted ram/flash memory, and/or stuffed storage struggling to maintain free space, that the session based data for that path suffers a transient hiccup, and the end result could well be the report you have in hand.

                             

                            Unless you can reliably repeat it on a device other than the one for that user, I'd just make a note and move on. It may not be worth your time beyond what you've already invested.

                             

                            If you find it is repeatable, you may want to burn a support ticket w/DTS via the Member Center, asking them to look at a project that reliably demonstrates the issue....they'd need that before they accept an assignment, I think.

                             

                            Sorry I couldn't help more.

                             

                            Ken