Details
Description
I opened a Couchbase Lite database that's never had a problem before, and crashed with an assertion failure. Below is the log from the time of the crash, and the values of the two structs involved in the assertion. I've also attached the database file.
17:25:15.042| WARNING: ForestDB error: FORESTDB ERROR -38
Assertion in 0x88 != 0x3 in /Couchbase/CouchbaseLite/vendor/CBForest/vendor/forestdb/src/hbtrie.cc:1109
Assertion failed: (btree->ksize == trie->chunksize && btree->vsize == trie->valuelen), function _hbtrie_find, file /Couchbase/CouchbaseLite/vendor/CBForest/vendor/forestdb/src/hbtrie.cc, line 1109.
(lldb) p *btree
(btree) $0 =
(lldb) p *trie
(hbtrie) $1 = {
chunksize = '\b'
valuelen = '\b'
flag = '\0'
leaf_height_limit = '\xff'
btree_nodesize = 4096
root_bid = 1937
btreeblk_handle = 0x0000000100624890
doc_handle = 0x000000010063b150
aux = 0x00000001006249d0
btree_blk_ops = 0x0000000100298568
btree_kv_ops = 0x00000001006215e0
btree_leaf_kv_ops = 0x0000000100621660
readkey = 0x00000001001ebbb0 (CouchbaseLite`::_fdb_readkey_wrap(void *, uint64_t, void *) at forestdb.cc:95)
map = 0x0000000100207b70 (CouchbaseLite`::fdb_kvs_find_cmp_chunk(void *, void *) at kv_instance.cc:375)
cmp_args =
last_map_chunk = 0x0000000100647110
}
(lldb) bt
- thread #1: tid = 0x34f1cc, 0x00007fff83bce286 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00007fff83bce286 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff85ed642f libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0x00007fff8c9b0b53 libsystem_c.dylib`abort + 129
frame #3: 0x00007fff8c978c39 libsystem_c.dylib`__assert_rtn + 321 - frame #4: 0x00000001001d4045 CouchbaseLite`_hbtrie_find(trie=0x0000000100624980, key=0x00007fff5fbfee40, keylen=32, valuebuf=0x00007fff5fbfefb8, btreelist=0x0000000000000000, flag='\0') + 821 at hbtrie.cc:1107
frame #5: 0x00000001001d3cdd CouchbaseLite`::hbtrie_find(trie=0x0000000100624980, rawkey=0x00007fff5fbfeeb0, rawkeylen=19, valuebuf=0x00007fff5fbfefb8) + 141 at hbtrie.cc:1251
frame #6: 0x00000001001f2a47 CouchbaseLite`::fdb_get(handle=0x000000010062e300, doc=0x00007fff5fbff120) + 839 at forestdb.cc:2206
...