Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
.master
-
None
-
iOS
-
Untriaged
-
Unknown
Description
We've gotten reports from outside developers of Couchbase Mobile applications crashing when they try to operate on the database while the app is in the background. The trigger seems to be iOS's file protection system: when the device is locked, the decryption keys for application files are unloaded and apps can't open files. (This can be changed on a per-file basis, and we need to do some work to make this more compatible with apps that want to use the database in the background.)
Crash logs can be found in:
https://github.com/couchbase/couchbase-lite-ios/issues/1433
{{
SIGABRT ABORT 0x0000000182b4411c
0 libsystem_kernel.dylib 0x182b4411c __pthread_kill + 8
1 libsystem_pthread.dylib 0x182c10ef8 pthread_kill + 112
2 libsystem_c.dylib 0x182ab5dac abort + 140
3 libsystem_malloc.dylib 0x182b70374 szone_size + 522
4 MyApp 0x100213088 btreeblk_free + 4297552008
5 MyApp 0x10022ff2c _fdb_close + 14516
6 MyApp 0x10022e984 fdb_check_file_reopen + 8972
7 MyApp 0x10023c52c fdb_kvs_open + 23632
8 MyApp 0x1001eff88 cbforest::Database::getKeyStore(std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >) const (Error.hh:58)
9 MyApp 0x1001f0268 cbforest::Database::updatePurgeCount() (Database.cc:220)
10 MyApp 0x1001efcf0 cbforest::Database::compactionCallback(_fdb_file_handle*, unsigned int, char const*, fdb_doc_struct*, unsigned long long, unsigned long long, void*) (Database.cc:399)
11 MyApp 0x1002336e8 _fdb_compact_file(_fdb_kvs_handle*, filemgr*, btreeblk_handle*, docio_handle*, hbtrie*, hbtrie*, btree*, btree*, unsigned long long, bool) + 28784
12 MyApp 0x100231e44 fdb_compact_file + 22476
13 MyApp 0x10021ea10 compactor_thread(void*) + 18468
14 libsystem_pthread.dylib 0x182c0fb28 _pthread_body + 156
15 libsystem_pthread.dylib 0x182c0fa8c _pthread_body + 154
16 libsystem_pthread.dylib 0x182c0d028 thread_start + 4
}}
{{
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000028
0 MyApp 0x1002cc7b4 list_pop_front + 316
1 MyApp 0x1002b33c0 _btreeblk_read(void*, unsigned long long, int) + 4297143232
2 MyApp 0x1002d7020 btree_init_from_bid + 1860
3 MyApp 0x1002cec18 fdb_sync_db_header + 9632
4 MyApp 0x1002b3874 fdb_begin_transaction + 4297144436
5 MyApp 0x1002904b0 cbforest::Database::beginTransaction(cbforest::Transaction*) (Database.cc:283)
}}