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

Lithium: Fix NPE in finalizer

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0.2
    • Java, Java-Android
    • Security Level: Public
    • None
    • 1

    Description

      We've had several customer notice an NPE in C4 object finalizers. While I suspect that these are harmless, I cannot prove it.

      The problem seems to be caused by a bug in the way Android handles finalization: deleting an object's fields, even though they are being used for synchronization, before finalizing the object on which they depend.

      I suggest backporting the fix that has been in Helium for a while: using the self object as a lock. This has the significant downside that it makes the lock visible. Since the lock is visible anyway, the risk seems minimal. It has also been running in Lithium for half a year.

      Attachments

        Issue Links

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

          Activity

            Build couchbase-lite-android-3.0.2-10 contains couchbase-lite-java-common commit a65e36f with commit message:
            CBL-3299: get rid of NPE in finalizer (#94)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-android-3.0.2-10 contains couchbase-lite-java-common commit a65e36f with commit message: CBL-3299 : get rid of NPE in finalizer (#94)

            Build couchbase-lite-android-3.0.2-10 contains couchbase-lite-java-ee-root commit f8b7089 with commit message:
            CBL-3299: get rid of NPE in finalizer (#94)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-android-3.0.2-10 contains couchbase-lite-java-ee-root commit f8b7089 with commit message: CBL-3299 : get rid of NPE in finalizer (#94)

            Build couchbase-lite-java-3.0.2-9 contains couchbase-lite-java-common commit a65e36f with commit message:
            CBL-3299: get rid of NPE in finalizer (#94)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-java-3.0.2-9 contains couchbase-lite-java-common commit a65e36f with commit message: CBL-3299 : get rid of NPE in finalizer (#94)

            Build couchbase-lite-java-3.0.2-9 contains couchbase-lite-java-ee-root commit f8b7089 with commit message:
            CBL-3299: get rid of NPE in finalizer (#94)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-java-3.0.2-9 contains couchbase-lite-java-ee-root commit f8b7089 with commit message: CBL-3299 : get rid of NPE in finalizer (#94)
            blake.meike Blake Meike added a comment -

            Fixed in 3.0.2

            blake.meike Blake Meike added a comment - Fixed in 3.0.2

            People

              blake.meike Blake Meike
              blake.meike Blake Meike
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty