Native crash freeing a C4DocumentObserver (c4docobs_free)

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

1
  • 24 May 2022, 10:22 PM

Activity

Show:

CB robot July 1, 2022 at 11:10 PM

Build couchbase-lite-log-3.1.0-167 contains couchbase-lite-core commit 7e4e981 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3193#icft=CBL-3193: Document Observer should retain the database it observes (#1497)

CB robot July 1, 2022 at 10:18 PM

Build couchbase-lite-cblite-3.1.0-157 contains couchbase-lite-core commit 7e4e981 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3193#icft=CBL-3193: Document Observer should retain the database it observes (#1497)

CB robot June 25, 2022 at 6:50 AM

Build couchbase-lite-net-3.1.0-74 contains couchbase-lite-core commit 7e4e981 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3193#icft=CBL-3193: Document Observer should retain the database it observes (#1497)

CB robot June 22, 2022 at 5:53 AM

Build couchbase-lite-ios-3.1.0-169 contains couchbase-lite-core commit 7e4e981 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3193#icft=CBL-3193: Document Observer should retain the database it observes (#1497)

CB robot June 21, 2022 at 9:57 PM

Build couchbase-lite-c-3.1.0-128 contains couchbase-lite-core commit 7e4e981 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3193#icft=CBL-3193: Document Observer should retain the database it observes (#1497)

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

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created May 24, 2022 at 10:21 PM
Updated July 1, 2022 at 11:10 PM
Resolved June 17, 2022 at 10:28 PM
Instabug