9 Replies
      Latest reply on Mar 7, 2019 1:46 AM by eskimo
      ecology Level 1 Level 1 (0 points)

        Why is the line number 0 for my source code in symbolicated crash log?

        At line 4 in Thread 0, the line number is 0 for (MyCodeModule.swift:0). Why is that? Is there a way to get more details about where it crashed?

         

        This is from a crash log a customer sent. The crash seems to be coming from somewhere in string processing routines.

         

        Are Swift line number references only delivered for functions/methods in Swift classes, but not free-standing functions?

         

        Also, is there a way to get symbolicated names for the libswiftCore.dylib lines in the crashed thread?

         

        Thread 0 name:  Dispatch queue: com.apple.main-thread
        Thread 0 Crashed:
        0   libswiftCore.dylib 0x0000000104c04324 0x104948000 + 2868004
        1   libswiftCore.dylib 0x0000000104bcbb6c 0x104948000 + 2636652
        2   libswiftCore.dylib 0x00000001049c48fc 0x104948000 + 510204
        3   libswiftCore.dylib 0x0000000104bd4f14 0x104948000 + 2674452
        4   MyAppName 0x0000000104536e00 specialized MyFunctionOne(_:parameter:) + 339456 (MyCodeModule.swift:0) <-- HERE
        5   MyAppName 0x000000010455c3b8 MyController.myMethodTwo(_:parameter:) + 492472 (MyController.swift:1090)

         

        Other pertinent lines from crash log:

         

        Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
        Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000020
        VM Region Info: 0x20 is not in any region.  Bytes before following region: 4367204320
              REGION TYPE  START - END [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
              UNUSED SPACE AT START --->
              __TEXT 00000001044e4000-00000001044e8000 [   16K] r-x/r-x SM=COW  ...pp/MyAppName
        Termination Signal: Segmentation fault: 11
        Termination Reason: Namespace SIGNAL, Code 0xb
        Terminating Process: exc handler [0]
        Triggered by Thread:  0
        Filtered syslog: None found
        • Re: Why is the line number 0 for my source code in symbolicated crash log?
          eskimo Apple Staff Apple Staff (11,065 points)

          4 … specialized MyFunctionOne(_:parameter:) + 339456 (MyCodeModule.swift:0)

          Why is the line number 0 for my source code in symbolicated crash log?

          Note the specialized at the front of the function name.  This indicates that:

          • MyFunctionOne(_:parameter:) is a generic function

          • The compiler, as an optimisation, has emitted a specialised version of that function

          • You’ve crashed in that specialised version

          It’s annoying that the compiler and symbolicator are not able to map this back to a real line of code.  I encourage you to file a bug about that.  Please post your bug number, just for the record.

          Also, is there a way to get symbolicated names for the libswiftCore.dylib lines in the crashed thread?

          This is a well-known problem caused by the way that the Swift runtime libraries get incorporated into your app.  Alas, I’ve not looked into this issue myself and thus I don’t know if there’s some clever way to symbolicate these frames.

          If you haven’t already done so I recommend that you try resymbolicating these logs.  You can find info on that process in both Technote 2151 Understanding and Analyzing iOS Application Crash Reports and Xcode’s help.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          WWDC runs Mon, 4 Jun through to Fri, 8 Jun.  During that time all of DTS will be at the conference, helping folks out face-to-face.

            • Re: Why is the line number 0 for my source code in symbolicated crash log?
              SushmithaDevi Level 1 Level 1 (0 points)

              Even i have got the similar results.Below are some of the crash logs for your reference.

               

              1->

              Thread 0 Crashed:
              0   WidgetExtension      0x0000000104ab84fc specialized ExtensionDataSource.tableView(_:cellForRowAt:) + 1036 (ExtensionDataSource.swift:0)
              1  WidgetExtension      0x0000000104ab7d90 @objc ExtensionDataSource.tableView(_:cellForRowAt:) + 92 (ExtensionDataSource.swift:0)
              2   UIKitCore                      0x00000001c7db4de4 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 684 (UITableView.m:13737)

              2->

              Thread 0 Crashed:
              0   libobjc.A.dylib                0x1b56fed2 objc_msgSend + 50
              1   QuartzCore                    0x1f399cf4 CA::Layer::begin_change(CA::Transaction*, unsigned int, objc_object*, objc_object*&) + 152 (CALayer.mm:5935)
              2   QuartzCore                    0x1f3951a6 -[CALayer setDelegate:] + 78 (CALayer.mm:5462)
              3   UIKit                          0x22773894 -[UIView dealloc] + 700 (UIView.m:3973)

              3->

              Thread 0 Crashed:
              0   libsystem_kernel.dylib        0x1c7e4fd0 _kernelrpc_mach_vm_deallocate_trap + 20
              1   libsystem_kernel.dylib        0x1c7ebc9c mach_vm_deallocate + 64 (mach_vm.c:80)
              2   libsystem_malloc.dylib        0x1c82e918 mvm_deallocate_pages + 78 (vm.c:234)
              3   libcompression.dylib          0x1e8de0ce lzfse_stream_end + 12 (lzfse_stream.c:69)

              4->

              Thread 0 Crashed:
              0   CoreUI                        0x21bf24fa -[_CSIRenditionBlockData expandCSIBitmapData:fromSlice:makeReadOnly:] + 1114 (CUIThemeRendition.m:0)
              1   CoreUI                        0x21bfc014 __csiCompressImageProviderCopyIOSurfaceWithOptions + 1516 (CUIThemeRendition.m:1581)
              2   QuartzCore                    0x1e7a3a20 CA::Render::(anonymous namespace)::create_image_from_image_provider(CGImage*, CGImageProvider*, CGColorSpace*, unsigned int) + 80 (render-image-cache.cpp:1191)
              3   QuartzCore                    0x1e7a2f8c CA::Render::create_image(CGImage*, CGColorSpace*, unsigned int, float) + 290 (render-image-cache.cpp:1478)

              5->

              Thread 0 Crashed:
              0   CoreFoundation                0x1c35f518 -[__NSCFString isEqual:] + 0 (CFObject.m:318)
              1   CoreFoundation                0x1c367e98 -[NSArray isEqualToArray:] + 272 (NSArray.m:462)
              2   Foundation                    0x1cd6f7f2 probeGC + 422 (NSMapTable.m:754)

               

              Is it possible to debug the above crashes and find the root cause?

            • Re: Why is the line number 0 for my source code in symbolicated crash log?
              benspratling4 Level 1 Level 1 (0 points)

              Hey, I'm seeing a similar crash report, i.e. KERN_INVALID_ADDRESS with pointers like 0x10, 0x20, and 0x30.  What turned out to cause that?

                • Re: Why is the line number 0 for my source code in symbolicated crash log?
                  eskimo Apple Staff Apple Staff (11,065 points)

                  I'm seeing a similar crash report, i.e. KERN_INVALID_ADDRESS with pointers like 0x10, 0x20, and 0x30.

                  Crashes like this mean that your app is accessing an invalid address.  In C-based languages they’re most commonly associated with dereferencing a NULL pointer.  If you’re using Swift that generally doesn’t result in a crash like this (if a value is optional, the compiler inserts code to explicitly trap if it’s nil) but the devil really is in the details here.  It’s unlikely that your problem has exactly the same cause of ecology’s.

                  My recommendation is that you start a new thread here in the Xcode > Debugger topic area and include a symbolicated Apple crash report for the crash.  Please format your crash report as a code block (using the <>) because that makes it much easier to read.

                  If you don’t know how to get a crash report, see Technote 2151 Understanding and Analyzing iOS Application Crash Reports.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"

                    • Re: Why is the line number 0 for my source code in symbolicated crash log?
                      benspratling4 Level 1 Level 1 (0 points)

                      Hi, thanks, eskimo, I know you give really good answers to stuff.  But in particular, of course my issue can't be a null dereference, because the pointers are like 0x10, 0x20, 0x30.  I have already tried creating my own post here, but my multiple attempts to create a post have been way-layed by "waiting on a moderator" for several days, so I've resorted to using replies to try to get information out of people having the only concsistent identifiable portion of the problem I do, i.e. EXC_BAD_ACCESS, KERN_INVALID_ADDRESS, with a pointer of something like 0x0...10, 0x0...20, 0x0...30, (high 0 bits omitted).  Since these crashes occur in a stack trace which includes 100% system code, often inside _CFRelease inside SecCertificateDestroy, or objc_msgSend inside [_CFXNotificationTokenRegistration copyHandler], or (very commonly) inside calloc(?!), and I can't make any of these happen in the lab, it's super hard to track down.  I'm hoping any information can help.  I was content with 1 random unsolvable crash per month, but for the last several weeks I've been getting 3-4 similar crash reports per day, and I don't have any clear path forward.

                        • Re: Why is the line number 0 for my source code in symbolicated crash log?
                          eskimo Apple Staff Apple Staff (11,065 points)

                          I have already tried creating my own post here, but my multiple attempts to create a post have been way-layed by "waiting on a moderator" for several days

                          The moderators seem to be doing a much better job these days.  Regardless, if you create a new thread and post the URL here, I’ll make sure it gets moderator approved promptly.

                          Share and Enjoy

                          Quinn “The Eskimo!”
                          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                          let myEmail = "eskimo" + "1" + "@apple.com"