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

Assertion when destructing database after calling beginTransaction() on the closed database

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.0
    • 3.1.0
    • LiteCore
    • Security Level: Public
    • None
    • 2

    Description

      LiteCore: 0a5d8f1df282f3be60df3cf76c14a345db23c390

      After using LiteCore C++ API to begin transaction on a closed c4Database which results expectedly to a NotOpen exception, there was an assertion failure later when the database was destructed. 

      Seem like _transactionLevel shouldn't be bumped if the transaction cannot begin.

      Log:

      error: Assertion failed: Database being destructed while in a transaction (DatabaseImpl.cc:294, in ~DatabaseImpl)
      	 0  libcblite.dylib           litecore::DatabaseImpl::~DatabaseImpl() + 688
      	 1  libcblite.dylib           litecore::DatabaseImpl::~DatabaseImpl() + 84
      	 2  libcblite.dylib           litecore::DatabaseImpl::~DatabaseImpl() + 80
      	 3  libcblite.dylib           fleece::RefCounted::_careful_release() const + 500
      	 4  libcblite.dylib           fleece::RefCounted::_release() const + 80
      	 5  libcblite.dylib           fleece::release(fleece::RefCounted const*) + 92
      	 6  libcblite.dylib           fleece::Retained<C4Database>::~Retained() + 208
      	 7  libcblite.dylib           fleece::Retained<C4Database>::~Retained() + 84
      	 8  libcblite.dylib           litecore::access_lock<fleece::Retained<C4Database>, std::recursive_mutex>::~access_lock() + 100
      	 9  libcblite.dylib           CBLDatabase::C4DatabaseAccessLock::~C4DatabaseAccessLock() + 84
      	10  libcblite.dylib           CBLDatabase::C4DatabaseAccessLock::~C4DatabaseAccessLock() + 84
      	11  libcblite.dylib           std::__shared_ptr_emplace<CBLDatabase::C4DatabaseAccessLock, std::allocator<CBLDatabase::C4DatabaseAccessLock> >::__on_zero_shared() + 140
      	12  libcblite.dylib           std::__shared_count::__release_shared() + 284
      	13  libcblite.dylib           std::__shared_weak_count::__release_shared() + 116
      	14  libcblite.dylib           std::shared_ptr<CBLDatabase::C4DatabaseAccessLock>::~shared_ptr() + 268
      	15  libcblite.dylib           std::shared_ptr<CBLDatabase::C4DatabaseAccessLock>::~shared_ptr() + 84
      	16  libcblite.dylib           CBLDatabase::~CBLDatabase() + 808
      	17  libcblite.dylib           CBLDatabase::~CBLDatabase() + 84
      	18  libcblite.dylib           CBLDatabase::~CBLDatabase() + 80
      	19  libcblite.dylib           fleece::RefCounted::_careful_release() const + 500
      	20  libcblite.dylib           fleece::RefCounted::_release() const + 80
      	21  libcblite.dylib           fleece::release(fleece::RefCounted const*) + 92
      	22  libcblite.dylib           CBL_Release 

       

      Note: I have noticed this when testing CBL-C API.

      Attachments

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

        Activity

          People

            jimb Jim Borden
            pasin Pasin Suriyentrakorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty