Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-1158

[Analyze&Report] Assertion failure (winning sequence > last sequence)

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 2.8.0
    • 2.8.0
    • iOS
    • Security Level: Public
    • Jay 26
    • 3

    Description

      Steps:

      • Run the `testDoubleConflictResolutionOnSameConflicts` iOS unit test.
      • Run the `testConflictResolutionDefault` iOS unit test.

      2020-07-24 14:46:27.349682-0700 xctest[38124:412159] CouchbaseLite Database ERROR: Assertion failed: docID && revID && sequence > _lastSequence (/Users/jayaharivavachan/Documents/cbl/couchbase-lite-ios-ee/couchbase-lite-ios/vendor/couchbase-lite-core/LiteCore/Database/SequenceTracker.cc:112, in documentChanged)
      	 0  CouchbaseLite             litecore::SequenceTracker::documentChanged(fleece::alloc_slice const&, fleece::alloc_slice const&, unsigned long long, unsigned long long) + 309
      	 1  CouchbaseLite             c4Internal::Database::documentSaved(c4Internal::Document*)::$_4::operator()(litecore::SequenceTracker&) const + 758
      	 2  CouchbaseLite             void litecore::access_lock<litecore::SequenceTracker, std::__1::recursive_mutex>::use<c4Internal::Database::documentSaved(c4Internal::Document*)::$_4>(c4Internal::Database::documentSaved(c4Internal::Document*)::$_4) + 356
      	 3  CouchbaseLite             c4Internal::Database::documentSaved(c4Internal::Document*) + 580
      	 4  CouchbaseLite             c4Internal::TreeDocument::resolveConflict(FLSlice, FLSlice, FLSlice, unsigned char, bool) + 5740
      	 5  CouchbaseLite             c4doc_resolveConflict::$_11::operator()() const + 1034
      	 6  CouchbaseLite             bool fleece::function_ref<bool ()>::callback_fn<c4doc_resolveConflict::$_11>(long) + 41
      	 7  CouchbaseLite             fleece::function_ref<bool ()>::operator()() const + 155
      	 8  CouchbaseLite             bool c4Internal::tryCatch<bool>(C4Error*, fleece::function_ref<bool ()>) + 369
      	 9  CouchbaseLite             c4doc_resolveConflict + 1349
      	10  CouchbaseLite                       0x000000010a646571 -[CBLDatabase saveResolvedDocument:withLocalDoc:remoteDoc:error:] + 6993
      	11  CouchbaseLite                       0x000000010a643e11 -[CBLDatabase resolveConflictInDocument:withConflictResolver:error:] + 8465
      	12  CouchbaseLite                       0x000000010a713451 -[CBLReplicator _resolveConflict:] + 1761
      	13  CouchbaseLite                       0x000000010a7125c4 __33-[CBLReplicator resolveConflict:]_block_invoke + 244
      	14  libclang_rt.asan_osx_dynamic.dylib __wrap_dispatch_async_block
      

      (lldb) bt
      * thread #10, queue = 'CBLReplicator[<- DB[otherdb]] : Conflicts', stop reason = breakpoint 2.1
          frame #0: 0x00007fff6a3120f8 libc++abi.dylib`__cxa_throw
        * frame #1: 0x000000010a34e9fd CouchbaseLite`litecore::error::assertionFailed(fn="documentChanged", file="/Users/jayaharivavachan/Documents/cbl/couchbase-lite-ios-ee/couchbase-lite-ios/vendor/couchbase-lite-core/LiteCore/Database/SequenceTracker.cc", line=112, expr="docID && revID && sequence > _lastSequence", message="docID && revID && sequence > _lastSequence") at Error.cc:592:9
          frame #2: 0x000000010aca98e5 CouchbaseLite`litecore::SequenceTracker::documentChanged(this=0x0000611000088a80, docID=0x0000615000090c08, revID=0x0000615000090c28, sequence=14, bodySize=2) at SequenceTracker.cc:112:9
          frame #3: 0x000000010aa824f6 CouchbaseLite`c4Internal::Database::documentSaved(this=0x00000001107b5320, st=0x0000611000088a80)::$_4::operator()(litecore::SequenceTracker&) const at Database.cc:680:20
          frame #4: 0x000000010aa6d1c4 CouchbaseLite`void litecore::access_lock<litecore::SequenceTracker, std::__1::recursive_mutex>::use<c4Internal::Database::documentSaved(this=0x0000611000088a80, callback=(anonymous class) @ 0x00000001107b5320)::$_4>(c4Internal::Database::documentSaved(c4Internal::Document*)::$_4) at access_lock.hh:38:13
          frame #5: 0x000000010aa6cfe4 CouchbaseLite`c4Internal::Database::documentSaved(this=0x0000612000053740, doc=0x0000615000090b80) at Database.cc:678:31
          frame #6: 0x000000010ac4bf6c CouchbaseLite`c4Internal::TreeDocument::resolveConflict(this=0x0000615000090b80, winningRevID=(buf = 0x000060600037eb71, size = 42), losingRevID=(buf = 0x000060600037ebd1, size = 42), mergedBody=(buf = 0x0000000000000000, size = 0), mergedFlags='\0', pruneLosingBranch=true) at TreeDocument.cc:331:22
          frame #7: 0x000000010a9243ea CouchbaseLite`c4doc_resolveConflict::$_11::operator(this=0x00000001107e6ea0)() const at c4Document.cc:627:26
          frame #8: 0x000000010a923fc9 CouchbaseLite`bool fleece::function_ref<bool ()>::callback_fn<c4doc_resolveConflict::$_11>(callable=4571688608) at function_ref.hh:59:12
          frame #9: 0x000000010ac9ef2b CouchbaseLite`fleece::function_ref<bool ()>::operator(this=0x00000001106fa020)() const at function_ref.hh:72:12
          frame #10: 0x000000010ac88e81 CouchbaseLite`bool c4Internal::tryCatch<bool>(outError=0x00000001108f6aa0, fn=function_ref<bool ()> @ 0x00000001106fa020)>) at c4ExceptionUtils.hh:60:20
          frame #11: 0x000000010a9191a5 CouchbaseLite`::c4doc_resolveConflict(doc=0x0000615000090b90, winningRevID=(buf = 0x000060600037eb71, size = 42), losingRevID=(buf = 0x000060600037ebd1, size = 42), mergedBody=(buf = 0x0000000000000000, size = 0), mergedFlags='\0', outError=0x00000001108f6aa0) at c4Document.cc:626:12
          frame #12: 0x000000010a0b3571 CouchbaseLite`-[CBLDatabase saveResolvedDocument:withLocalDoc:remoteDoc:error:](self=0x000060c00004c480, _cmd="saveResolvedDocument:withLocalDoc:remoteDoc:error:", resolvedDoc=0x00006070000a01b0, localDoc=0x00006070000a0140, remoteDoc=0x00006070000a01b0, outError=0x0000000110883760) at CBLDatabase.mm:1228:14
          frame #13: 0x000000010a0b0e11 CouchbaseLite`-[CBLDatabase resolveConflictInDocument:withConflictResolver:error:](self=0x000060c00004c480, _cmd="resolveConflictInDocument:withConflictResolver:error:", docID="doc3", conflictResolver=0x0000602000053b90, outError=0x00000001107dfc60) at CBLDatabase.mm:1160:24
          frame #14: 0x000000010a180451 CouchbaseLite`-[CBLReplicator _resolveConflict:](self=0x0000610000036d40, _cmd="_resolveConflict:", doc=0x0000606000391dc0) at CBLReplicator.mm:647:10
          frame #15: 0x000000010a17f5c4 CouchbaseLite`__33-[CBLReplicator resolveConflict:]_block_invoke(.block_descriptor=0x00006040002d66d0) at CBLReplicator.mm:629:9
          frame #16: 0x0000000100154cdb libclang_rt.asan_osx_dynamic.dylib`__wrap_dispatch_async_block_invoke + 203
          frame #17: 0x00007fff6cf886c4 libdispatch.dylib`_dispatch_call_block_and_release + 12
          frame #18: 0x00007fff6cf89658 libdispatch.dylib`_dispatch_client_callout + 8
          frame #19: 0x00007fff6cf8b818 libdispatch.dylib`_dispatch_continuation_pop + 414
          frame #20: 0x00007fff6cf8af16 libdispatch.dylib`_dispatch_async_redirect_invoke + 703
          frame #21: 0x00007fff6cf97957 libdispatch.dylib`_dispatch_root_queue_drain + 326
          frame #22: 0x00007fff6cf98097 libdispatch.dylib`_dispatch_worker_thread2 + 92
          frame #23: 0x00007fff6d1e39f7 libsystem_pthread.dylib`_pthread_wqthread + 220
          frame #24: 0x00007fff6d1e2b77 libsystem_pthread.dylib`start_wqthread + 15
      Program ended with exit code: 9
      

      Attachments

        1. analysis_cbl1158.txt
          15 kB
          Jay Vavachan
        2. cbl1158.txt
          181 kB
          Jay Vavachan

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Jayahari.Vavachan Jay Vavachan
              Jayahari.Vavachan Jay Vavachan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty