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

Thread leaked by fdb_close

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • .master
    • .master
    • forestdb
    • None
    • Untriaged
    • MacOSX 64-bit
    • Unknown
    • ForestDB: Oct 17 - Nov 4

    Description

      In some circumstances ForestDB can leak pthreads; the thread sanitizer in the new Xcode 8 beta reports this in a few of my unit tests.

      It looks like the problem occurs when:

      • filemgr_prefetch creates a new thread and stores its handle in file->prefetch_tid (filemgr.cc:628)
      • filemgr_free_func is called when the database closes, but its prefetch_state is not FILEMGR_PREFETCH_RUNNING, so it does not call thread_join on the prefetch_tid. (filemgr.cc:1370-1375)

      There are no other API calls that use prefetch_tid, so nothing else will terminate that thread.

      NOTE: I'm on forestdb commit fd41b293, from the stable branch as of 4/23.

      Attachments

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

        Activity

          People

            jung-sang Jung-Sang Ahn (Inactive)
            jens Jens Alfke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty