0

I've received the following log from a customer who claims to be sharing photos from the photos app via Share Extension. The customer is making an assumption that internet connection to the router is bad. The behavior as described by the customer is as follows:

  1. Upload a file via share extension via a bad connection
  2. Let device sleep, in our case the connection should get terminated and the file is not uploaded to our servers.
  3. Attempt to re-upload the same file.

Expected Result: The file should upload fine.

Actual Result: Share Extension never loads, that means that user can infinitely click the app icon with no success of showing the view.

Adding to this, we have never been able to reproduce such a problem in house. However, the customer can do so every time while in the airport.

I took a peek in his device logs, and I can see the following with no clue what is going in. Starting from the out of bound exception which I can't explain due to the fact that the view never loaded.

Any idea or did anyone else encounter the same problem?

Apr 13 15:11:07 audi pkd[153] : assigning plug-in (2.1.2) to plugin sandbox

Apr 13 15:11:07 audi pkd[153] : enabling pid=386 for plug-in (2.1.2) D89CEF37-B025-4C6F-A8B6-FBB6B4D94A84/private/var/containers/Bundle/Application/AF69E215-04AE-4929-A8C8-51BE8FADF397/.app/PlugIns/.appex

Apr 13 15:11:07 audi kernel[0] : xpcproxy[451] Container: /private/var/mobile/Containers/Data/PluginKitPlugin/669C0F52-1C21-441D-9906-E2EFBD8A7D00(sandbox)

Apr 13 15:11:08 audi kernel[0] : LwVM::_generateMappedExtentsList - failed to map unmap range to partition

Apr 13 15:11:08 audi backboardd[60] : Unable to bootstrap_look_up port with name .gsEvents: unknown error code (1102) Apr 13 15:11:08 audi[451] : * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]' First throw call stack: (0x18400ae38 0x18366ff80 0x183eeb158 0x1000e4a40 0x1000e4738 0x183a554bc 0x183a5547c 0x183a5ab84 0x183fc0dd8 0x183fbec40 0x183ee8d10 0x1857d0088 0x1891bdf70 0x183cacd74 0x183caea2c 0x184acbd30 0x18b2e2c48 0x18b2e28dc 0x18b2e2c6c 0x1848de058 0x183a868b8)

Apr 13 15:11:08 audi MobileSlideShow[386] : plugin interrupted

Apr 13 15:11:08 audi MobileSlideShow[386] : plugin invalidated

Apr 13 15:11:08 audi diagnosticd[84] : error evaluating process info - pid: 451, puniqueid: 451

Apr 13 15:11:08 audi mediaserverd[28] : '' (pid = 451) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None

Apr 13 15:11:08 audi MobileSlideShow[386] : 2016-04-13 15:11:08.629|MobileSlideShow|0x14ce07cd0: HOST: Failed to load remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named .viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo= {NSDebugDescription=The connection to service named .viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}

Apr 13 15:11:08 audi MobileSlideShow[386] : 2016-04-13 15:11:08.633|MobileSlideShow|0x14ce07cd0: Sheet not being presented, calling premature completion

Apr 13 15:11:08 audi com.apple.xpc.launchd[1] ([451]) : Service exited due to signal: Abort trap: 6

Apr 13 15:11:08 audi ReportCrash[452] : Formulating report for corpse[451]

Apr 13 15:11:08 audi ReportCrash[452] : Report of type '109(109_)' not saved because the limit of 25 logs has been reached

Apr 13 15:11:08 audi ReportCrash[452] : Notice: This report is abbreviated for syslog inclusion because it could not be saved to disk.

Symbolication may be possible by manually cleaning up and including the Binary Image section of a full report from this same device – good luck!

Apr 13 15:11:08 audi ReportCrash[452] : Process: [451] Path: /private/var/containers/Bundle/Application/AF69E215-04AE-4929-A8C8-51BE8FADF397/.app/PlugIns/.appex/

Ahmed Ebaid
  • 417
  • 6
  • 21
  • sometimes users come up with real bizarre scenarios that can't be reproduced. The only way you can debug this problem is to literally "fly" to that airport, login to their wifi and hope for the best that your app crashes the same way and again hope you can figure out what proxy setting is blocking the upload connection. If you ask me this is a lost cause and tell the user to use 4G connection instead and move on. – Sam B Mar 29 '17 at 19:00
  • The major thing for this user is that he no longer can share that same file from anywhere after the airport incident. However, he can share the same file using other apps via share extension. – Ahmed Ebaid Mar 29 '17 at 19:36
  • how about copy and renaming the file to something else? Does it work then? I have seen way too many of these array beyond bounds errors while working with my apps. There really is a code bug in your code. Through some weird way the user has triggered it. I suggest tell the user to delete and reinstall app. If that's not an option, good luck man. – Sam B Mar 29 '17 at 21:53
  • @SamB, could it be a bug in my code even though no view is loaded. I've added extra logging into the viewDidLoad method to see what gets executed. – Ahmed Ebaid Mar 29 '17 at 22:09

1 Answers1

0

in many cases the file is large, and connection is being freed before finishing, or something in same vane is happing, if it is something in this vane, a possible way around, write your file to app document folder first, then upload via a URL link from your document folder in app like this: (example with an image)

let documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let path = documentsDirectoryPath.appending("/outImage.jpg")
let outURL = URL(fileURLWithPath: path)

try? FileManager.default.removeItem(at: outURL)

        if let data2c = self.newImage.jpegData(compressionQuality:1.0)
        {
            do
            {
                try data2c.write(to: outURL)

                DispatchQueue.main.async
                {
                    var filesToShare = [Any]()
                    filesToShare.append(outURL)

                    let activityVC = UIActivityViewController(activityItems: filesToShare, applicationActivities: nil)
                    activityVC.excludedActivityTypes = [.print,.assignToContact,.copyToPasteboard,.addToReadingList,.markupAsPDF,.postToTencentWeibo,.postToTencentWeibo]
                    activityVC.popoverPresentationController?.sourceView = self.view
                    activityVC.preferredContentSize = CGSize(width: self.view.frame.size.width, height: self.view.frame.size.height-60)
                    activityVC.modalPresentationCapturesStatusBarAppearance = true

                    self.present(activityVC, animated: true, completion: nil)
                }

            } catch {
  print("Couldn't write file")
            }
        }
hokkuk
  • 675
  • 5
  • 21