-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fatal Exception: mapbox::sqlite::Exception: disk I/O error #4841
Comments
Looks like an uncaught C++ exception while evicting resources from the cache. /cc @jfirebaugh |
Any news on this? |
Sounds like something to do with Can you trigger it by browsing and immediately locking the phone? |
That seems to trigger it sometimes (i guess only when i'm fast enough). |
As we expiring these crashes frequently we need a solution. In which directory are these caches saved? I will try to mark these directory with no file protection to see if these errors disappear. |
In iOS SDK v3.2.0 and above, the cache is saved at ~/Library/Application Support/tld.app.bundle.id/cache.db, where tld.app.bundle.id is your application’s bundle identifier. |
#5592 gives the hint that you can use |
It may turn out to be unnecessary, but as @tmpsantos suggested, the system file protection key for cache.db may also need to be modified. |
I think the right fix for this is #5236, so that no IO happens when an app is backgrounded. |
Actually, I take that back -- you would want offline downloads to continue in the background. The pause/resume API should only be about automatic revalidation. |
Setting the cache.db and the containing directory to NSFileProtectionNone seemed to fix it - instead #5651 pops up now. |
Note that the cache.db file moved as a result of #5601, so you may need to set |
Seems to be fixed in 3.3.0. |
Thanks, @MikeKasperlik! Let us know if it crops back up. |
This is reportedly still a problem in v3.3.4. |
We expect that this issue will be resolved by #8125 that is in the Mapbox iOS SDK as of 3.5.0 beta 2. I'll leave this issue open for tracking until we can collect more evidence that this particular sqlite error no longer occurs. |
This is still a problem for me in 3.5.4. It seems to happen the first time the app launches after a fresh install. |
Thanks for the report @jadar and I'm sorry to hear that.
That's interesting. If you have any other details that you can share (i.e. patterns of device / iOS version, crash logs, frequency, etc.) we would greatly appreciate it. |
Thanks for the quick reply. Right now I'm testing on an iPhone 7 with iOS 10.3.1. The issue happens about every time when we're logging into our app and all the views are initializing (including a MGLMapView.) After that first login, though, the app launches pretty reliably each subsequent time with only non-crashing exceptions being thrown & caught on. Maybe because the cache SQLite is fresh? |
@jadar Are you actually getting an application crash, or is it just stopping in the debugger, e.g. because you have an exception breakpoint enabled? Exceptions are used for flow control in this specific instance, so the fact that one is being thrown isn't necessarily an indication of a bug. |
Yes, you're right. I'm getting both and it's sometimes hard for me to tell which one I'm getting. It seems indeterminate if it's an exception or a crash, but the crashes are happening. |
What are the symptoms that lead you to believe there's a crash, and not just a (handled) exception? |
Just some more background, this app uses CoreData and it does some data processing in a background CoreData context. CoreData also uses SQLite to provide persistence. Here are the call stacks for when an actual crash happens. It appears it happens while we're doing more background data processing, which would explain why it only happens during some launches. |
Can you post the console output and the full stack trace from the "DefaultFileSource (13)" thread? (In the screenshot frames 1-13 have been collapsed.) |
Crash log: https://pastebin.com/cJY5Km80 |
I might have just figured out my issue. I found a spot in our app where the entire Application Support directory was deleted to remove all caches. I changed it to only remove certain directories and it seems that the crash has stopped occurring. I will admit that was our oversight. But there would be two things that would be extremely helpful for both us and other people to debug:
|
We see a crash that happens frequently. I don't know how to trigger this. We also do nothing fancy with mapbox currently, only setting the camera to the users location + creating some annotations.
According to crashlytics this only happens when the app is not in foreground - maybe an issue with file protection?
Platform: iOS 9.2.1 - iOS 9.3.1
Mapbox SDK version: 3.2.1
Other threads:
The text was updated successfully, but these errors were encountered: