Crash on iOS with assertion failing on !_changeTracker


#1

Using couchbase lite 1.2.1 for iOS we are seeing an assertion failure recorded on crashlytics with the following stack on a thread named CouchbaseLite.

Fatal Exception: NSInternalInconsistencyException !_changeTracker

15 Concepts                       0x1005e0c9c _AssertFailed + 470248
16 Concepts                       0x100589880 -[CBLRestPuller startChangeTracker] + 112844
17 Concepts                       0x100589304 -[CBLRestPuller beginReplicating] + 111440
18 Concepts                       0x100588530 __45-[CBLRestReplicator fetchRemoteCheckpointDoc]_block_invoke + 107900
19 Concepts                       0x100587adc __61-[CBLRestReplicator sendAsyncRequest:path:body:onCompletion:]_block_invoke + 105256
20 Concepts                       0x10059ab38 -[CBLRemoteRequest respondWithResult:error:] + 183172
21 Concepts                       0x10059c1ec -[CBLRemoteJSONRequest connectionDidFinishLoading:] + 188984
22 CFNetwork                      0x18231d6a0 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 80
23 CFNetwork                      0x18231d630 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 200
24 CFNetwork                      0x18231d7a4 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
25 CFNetwork                      0x18218339c ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 100
26 CFNetwork                      0x18227741c ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 108
27 libdispatch.dylib              0x1815ed47c _dispatch_client_callout + 16
28 libdispatch.dylib              0x1815f67b8 _dispatch_block_invoke + 540
29 CFNetwork                      0x18216fac0 RunloopBlockContext::_invoke_block(void const*, void*) + 36

This issue looks similar except there are no symbols there… https://github.com/couchbase/couchbase-lite-ios/issues/794

That issue is closed with the enigmatic “found the problem, it has to do with how we use CBL with GCD.”

I would appreciate any ideas on what we might be doing wrong with GCD to cause this?


#2

I don’t know any more about that comment either; it sounds like they had a thread-safety problem in their app code?


#3

Please post your backtrace to the Github issue and I’ll reopen it.


#4

Thanks, that’s done!