Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fatal Exception: mapbox::sqlite::Exception unable to open database file #5651

Closed
MikeKasperlik opened this issue Jul 12, 2016 · 18 comments
Closed
Labels
crash iOS Mapbox Maps SDK for iOS

Comments

@MikeKasperlik
Copy link

We see another crash which happens very frequently in our app. Maybe it's related to #4841 but it has a different stack trace / error message.

Platform: iOS
Mapbox SDK version: 3.2.3 - 3.3.0-rc.1

Fatal Exception: mapbox::sqlite::Exception unable to open database file

Crashed: DefaultFileSource
0  PACEApp                        0x1006fbfa8 CLSProcessRecordAllThreads + 4301553576
1  PACEApp                        0x1006fbfa8 CLSProcessRecordAllThreads + 4301553576
2  PACEApp                        0x1006fc3c8 CLSProcessRecordAllThreads + 4301554632
3  PACEApp                        0x1006ed088 CLSHandler + 4301492360
4  PACEApp                        0x1006fa6bc __CLSExceptionRecord_block_invoke + 4301547196
5  libdispatch.dylib              0x181d2547c _dispatch_client_callout + 16
6  libdispatch.dylib              0x181d30728 _dispatch_barrier_sync_f_invoke + 100
7  PACEApp                        0x1006fa168 CLSExceptionRecord + 4301545832
8  PACEApp                        0x1006f9cec CLSTerminateHandler() + 4301544684
9  libc++abi.dylib                0x181932f44 std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x181932b10 __cxa_rethrow + 144
11 libobjc.A.dylib                0x181940120 objc_exception_rethrow + 44
12 CoreFoundation                 0x1821b8cf8 CFRunLoopRunSpecific + 552
13 CoreFoundation                 0x1822063a4 CFRunLoopRun + 112
14 Mapbox                         0x10193b6b8 void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>, 0ul, 1ul>(std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 156
15 Mapbox                         0x10193b5d8 std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(mbgl::util::ThreadContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 136
16 libsystem_pthread.dylib        0x181f3fb28 _pthread_body + 156
17 libsystem_pthread.dylib        0x181f3fa8c _pthread_body + 154
18 libsystem_pthread.dylib        0x181f3d028 thread_start + 4

I can't reproduce it every time, but it happens 100% when the app is in background (according to crashlytics).

I attempted to fix it by setting the cache.db and the containing directory to NSFileProtectionNone - but that didn't do anything.

@MikeKasperlik
Copy link
Author

Seems to be fixed in 3.3.0.

@ampedersen
Copy link

I am getting this error on Android this morning.

E/libc++abi: terminating with uncaught exception of type mapbox::sqlite::Exception: unable to open database file

@vanshg
Copy link

vanshg commented Aug 26, 2016

I also started getting this error on Android. Maybe a 4.2.0-beta.2 bug? @tobrun

@tobrun
Copy link
Member

tobrun commented Aug 26, 2016

cc @friedbunny

@vanshg
Copy link

vanshg commented Aug 26, 2016

@tobrun @friedbunny
If I fresh install my application with 4.2.0-beta.2, I get the crash when I start panning. If I then downgrade back to 4.1.1, I still continue to get the error.

However, if I fresh install with 4.1.1, the error goes away. If I then upgrade to 4.2.0-beta.2 from 4.1.1, there is no crash.

So I'm guessing it has something to do with the way 4.2.0 creates the sqlite database

@vanshg
Copy link

vanshg commented Aug 26, 2016

The Demo app also continuously crashes on every sample (not just new ones). Not sure if related, but could be

@friedbunny
Copy link
Contributor

@vanshg @drsheman What version of Android are you using and on which devices?

The database schema did change in 4.2.0-beta.2 (#5796) and trying to use an upgraded database with an older SDK version will not work.

@vanshg
Copy link

vanshg commented Aug 26, 2016

7.0, Nexus 6P

@friedbunny
Copy link
Contributor

@vanshg If you could, please post a stack trace of the Android crash from a fresh 4.2.0-beta.2 install.

@vanshg
Copy link

vanshg commented Aug 26, 2016

Don't seem to be getting the crash anymore from fresh install of 4.2.0. I'll post one if it happens again. However, the Demo app does still keep crashing

@friedbunny
Copy link
Contributor

The original issue in this thread related to iOS and appears to have been resolved, so let’s move Android discussion to #6193.

@friedbunny
Copy link
Contributor

Reports of this issue on iOS v3.3.4, so I’m reopening.

@devinross
Copy link

devinross commented Feb 7, 2017

See this issue from commit 4cff0977a0 on iOS

@devinross
Copy link

Any movement on this issue?

@boundsj
Copy link
Contributor

boundsj commented Mar 16, 2017

It is possible this issue will also be fixed by #8125 that will be in the next Mapbox iOS SDK release (3.5.0). However, there are still no known repro steps here so we will leave this open for now for tracking.

@Sealos
Copy link

Sealos commented Aug 14, 2017

I'm also seeing this issue on Mapbox 3.6. Can't reproduce locally, however, we've seen plenty of crashes in fabric due to this exception.

Fatal Exception: mapbox::sqlite::Exception: unable to open database file

#16. Crashed: DefaultFileSource
0  XXXXXXXX                       0x10039f300 CLSProcessRecordAllThreads (CLSProcess.c:376)
1  XXXXXXXX                       0x10039f300 CLSProcessRecordAllThreads (CLSProcess.c:376)
2  XXXXXXXX                       0x10039f1b0 CLSProcessRecordAllThreads (CLSProcess.c:407)
3  XXXXXXXX                       0x10038fa98 CLSHandler (CLSHandler.m:26)
4  XXXXXXXX                       0x10039d3a4 __CLSExceptionRecord_block_invoke (CLSException.mm:199)
5  libdispatch.dylib              0x181bf69a0 _dispatch_client_callout + 16
6  libdispatch.dylib              0x181c03ee0 _dispatch_barrier_sync_f_invoke + 84
7  XXXXXXXX                       0x10039ce50 CLSExceptionRecord (CLSException.mm:206)
8  XXXXXXXX                       0x10039c964 CLSTerminateHandler() (CLSException.mm:265)
9  libc++abi.dylib                0x18178f5d4 std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x18178f1a8 __cxa_rethrow + 144
11 Mapbox                         0x100ae1d9c mbgl::OfflineDatabase::ensureSchema() + 928
12 Mapbox                         0x100ae19bc mbgl::OfflineDatabase::OfflineDatabase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long long) + 88
13 Mapbox                         0x100ad3834 _hidden#9206_ + 516
14 Mapbox                         0x100ad3720 void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>, 0ul, 1ul>(std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 240
15 Mapbox                         0x100ad368c std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(mbgl::util::ThreadContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 92
16 libsystem_pthread.dylib        0x181e0168c _pthread_body + 240
17 libsystem_pthread.dylib        0x181e0159c _pthread_body + 282
18 libsystem_pthread.dylib        0x181dfecb4 thread_start + 4

@Sealos
Copy link

Sealos commented Oct 6, 2017

Any updates on this? This issue is the second and third top crash, reported by Fabric. It occurs to a very small population (~8-14 users) but has over 1500 crashes reported in one week.

Mapbox is linked Dynamically, and we're using Mapbox 3.6.3.

@kkaefer
Copy link
Member

kkaefer commented Aug 15, 2018

Fixed in #12224

@kkaefer kkaefer closed this as completed Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

9 participants