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

UBSan: CouchKVStore: invalid access to incomplete object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 5.5.0
    • couchbase-bucket
    • Untriaged
    • Unknown

    Description

      UBSan reports the following undefined behaviour when constructing a CouchKVStore object:

      couch-kvstore.cc:305:20: runtime error: member access within address 0x000107b17000 which does not point to an object of type 'CouchKVStore'
          0x000107b17000: note: object has invalid vptr
      

      The issue is that we are passing a reference to a class member variable (fileRevMap) before it has been constructed.

      The reason for the code to do this was to handle Read-Only and Read-Write CouchKVStore instances; which share a single revision map object between them - the r/w instance uses it's own (concrete) revisionMap member variable; whereas the r/o uses a reference to the
      R/W's member.

      Attachments

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

        Activity

          People

            drigby Dave Rigby (Inactive)
            drigby Dave Rigby (Inactive)
            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