Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-26840

~EventuallyPersistentEngine() should use the objects owned by it only before deleting them

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 5.1.0
    • 4.6.3, 5.0.0
    • couchbase-bucket
    • None

    Description

      ~EventuallyPersistentEngine() will invoke all the destructors (KVBucket, DCPConnMap, etc..) and these destructors will invoke other destructors.

      However, most of the objects in kv-engine hold a reference to the EventuallyPersistentEngine obj. It is quite likely that the destructors of those objects use the EventuallyPersistentEngine obj. For example: ~EventuallyPersistentEngine() --> ~DCPConnMap() --> ~Producer() --> ~ActiveStream() and there we try to get the reference to the 'Vbucket' using the 'KVBucket' object in EventuallyPersistentEngine obj.

      However, if ~EventuallyPersistentEngine() has already deleted its 'KVBucket' then we could crash on a nullptr access (http://review.couchbase.org/#/c/84652/4/engines/ep/src/ep_engine.cc was to avoid one such crash found in unit tests).

      So, we should revisit on the order in which the EventuallyPersistentEngine objects are deleted in ~EventuallyPersistentEngine() and carefully have an explicit order that we want.

      Attachments

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

        Activity

          People

            drigby Dave Rigby (Inactive)
            manu Manu Dhundi (Inactive)
            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