Lithium: Fix NPE in finalizer

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.

is subtask of

Activity

Show:

Blake Meike July 8, 2022 at 3:19 AM

Fixed in 3.0.2

CB robot June 16, 2022 at 4:46 PM

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

CB robot June 16, 2022 at 4:46 PM

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

CB robot June 16, 2022 at 4:46 PM

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

CB robot June 16, 2022 at 4:46 PM

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

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created June 14, 2022 at 4:58 PM
Updated July 29, 2022 at 4:18 PM
Resolved June 15, 2022 at 12:28 AM
Instabug