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

Native crash freeing a C4DocumentObserver (c4docobs_free)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.0
    • 3.1.0
    • LiteCore
    • Security Level: Public
    • None
    • Jim 76
    • 3

    Description

      A C4DocumentObserver is and AutoClosable object. This is an indication to client code that they object should always have its `close` method called, as part of freeing it.

      As a backstop, thought, a finalizer should be able to close the object successfully.

      I've included two examples of native crashes. Both occur when a finalizer attempts to close the observer.

      The Java code had a memory leak that prevented the observers that were not explicitly closed, from every being released (and thus finalized). Fixing that bug has revealed this one.

      This bug is quite reproducible.

      Just a guess: I wonder if the db is already gone....

      Attachments

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

        Activity

          People

            jimb Jim Borden
            blake.meike Blake Meike
            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