Crashed: com.apple.root.default-qos
Asked Answered
P

1

13

I have a fairly simple app that parses a RSS feed and shows it's content in a table view. It's available on the App Store. I have Crashlytics crash reporting integrated. I recently received two reports. These are a little difficult to decipher.

This has occurred in an iPhone 6 running iOS 10.2.1.

enter image description here

This is from an iPhone 5 running iOS 10.2.1.

enter image description here

Even though it says it's crashing due to privacy violations, I'm not accessing any services that requires permission in my app.

Also searching on com.apple.root.default-qos lead me to believe that this may have something to do with background threads. The only place where I use a background thread is to parse the RSS feed data.

DispatchQueue.global(qos: .background).async {

    guard let data = try? Data(contentsOf: URL) else {
        return
    }

    do {
        let xmlDoc = try AEXMLDocument(xml: data)

        if let items = xmlDoc.root["channel"]["item"].all {
            self.posts.removeAll()

            for item in items {
                let title = item["title"].value ?? ""
                // ...
                self.posts.append(jobPost)
            }

            DispatchQueue.main.async {
                self.saveposts(self.posts)
                self.posts.sort { $0.publishDate > $1.publishDate }
                self.tableView.reloadData()
                UIApplication.shared.toggleNetworkActivityIndicator(show: false)
                self.toggleUI(enable: true)
                if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
            }

        }

    } catch let error as NSError {
        print("RSS parsing failed: \(error)")
        self.showErrorAlert(error)
        UIApplication.shared.toggleNetworkActivityIndicator(show: false)
        self.toggleUI(enable: true)
        if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
    }
}

I tested this code on my iPhone 5 running iOS 9.3.5 and simulators running iOS 10.2 but no crash occurred.

Is there any other way to track down this problem?

Phyla answered 10/3, 2017 at 16:23 Comment(10)
This looks like a permissions issue, are you sure you're not using something that requires permission and the device you're testing on already grants that permission? See this and this. Also, here's Apple's list of permissions.Kochi
I double checked everything. In my device, it has the usual Cellular Data enabled in Settings and that's it. Since my device is still in iOS 9, I tested this again by resetting the simulator that runs iOS 10.2 and reinstalled the app. Still no crash. The other thing is, if it was really a permission related crash, I'd get the whole which permission is missing error message with the crash report which I didn't in this case.Phyla
And also I should note that only two occurrences (one each) of these errors were reported. Other users are having 100% crash free sessions.Phyla
Are you using an ad framework? Make sure you've check which permissions it requires - could be occasionally serving an ad that requires some odd permission. You don't necessarily see a permission missing message - e.g. if you're trying to use CoreMotion data.Prelusive
@AshleyMills Nope, no ads. I use Realm, AEXML and your Reachability library :DPhyla
Well, I'm pretty sure I'm not the guilty one! :DPrelusive
haha...yeah, can't be any of the libraries as I've used them in other projects without an issue.Phyla
Worth having a scan through here and checking if you're doing something you thought didn't need approval… developer.apple.com/library/prerelease/content/documentation/…Prelusive
By any chance are using a share feature to share app content such as images with social media? If you are, the Save Image button in UIActivityViewController will cause a crash if the gallery permission is not given, for example.Kochi
@Kochi I do have a share feature but I have added saveToCameraRoll as an excluded activity type.Phyla
C
7

I would double check all your permissions. In my case, starting with iOS10 you need permissions to save stuff to the user's camera roll. In my app, I was showing a default share sheet and whenever a user selected "save photo" the app crashed with one of these very not helpful error messages. I added

<key>NSPhotoLibraryAddUsageDescription</key>
    <string>Allow you to save charts and graphs from the app to your phone.</string>

to my info.plist, clean & run. And everything the problem was solved.

Cyclotron answered 16/10, 2017 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.